Table Design

D

dave.degroot

How do you guys go about with your table design... how do you make
sure that it's right before proceding with the implementation/coding?

Any pointers for a beginner? I've taken a class, but it's still a
painful process... Just wondering what you all think about this...

Thanks!

David
 
D

Dale Fye

David,

Good database design takes a thorough requirements analysis process. You
should thoroughly examine what information you want to store in your
database, and then start designing your tables on paper. You need to take
into account such things as do you want to have combo boxes for people to
select from, if so, this might require additional tables to define these
lists (I almost never use Value Lists for my Access databases because they
are too hard to edit).

You also need to identify what information is related and how (are they
one-to-one, one-to-many, or many-to-many relationships). As you determine
this information, you will likely move some fields out of one table and into
another. An example of this might be phone numbers. Many newbies to
databases will be inclined to use the spreadsheet method, and just add a
separate field to their Employees data table for Home_Phone, Work_Phone,
Cell_Phone and be satisfied with that, but a more experienced developer might
create an Employee_Phone_Numbers table so that would contain an ID field
(autonumber), an Employee_ID field (long integer Foreign Key to the
Employee_ID PK field in the Employees table), a Phone_Type_ID field (long
integer Foreign key to the Phone_Type_ID PK field in tbl_Phone_Types), and
finally a Phone_Number field. Using this format, you can add types of phones
(Home, Work, Cell, Pager, ...) and if technology results in a new type of
phone, you just have to add it to tbl_Type_Phones to allow the users to fill
this in.

Reality is that most people don't go to this level of detail in the
requirements process, and the final product looks like it. The biggest
problem I have is that when I build databases at work, the people that want
the database are not generally willing to sit down and define their
requirements, they just give you a general "I want a database to do this"
kind of mission statement, and leave it up to me to figure out what they
want. Then, as they start to use the product, want all sorts of bells and
whistles added on. This frequently results in less than optimal database
design.

If you are developing something that only you will be using, then this is
not a big deal, although poor design can complicate the development effort.
If, on the other hand, you are developing your application for multiple users
or for use at the office, fixing bad design decisions can take significant
effort.

Hope this doesn't sound too dismal. The key, in my mind is doing a thorough
requirement analysis up front.

Dale
 
J

Jason Lepack

The biggest step is to make sure that the database is normalised.
Look it up online, there are lots of examples. You could also post
your table structures here and we would be glad to give you a helping
hand.

Ex.
Employees:
EmployeeID - Autonumber
EmployeeName - Text

Jobs:
JobID - Autonumber
JobNumber - Number
ItemID - Number

EmployeeJob:
EmployeeID - AutoNumber
JobID - Number
Duration - Number
 
D

dave.degroot

David,

Good database design takes a thorough requirements analysis process. You
should thoroughly examine what information you want to store in your
database, and then start designing your tables on paper. You need to take
into account such things as do you want to have combo boxes for people to
select from, if so, this might require additional tables to define these
lists (I almost never use Value Lists for my Access databases because they
are too hard to edit).

You also need to identify what information is related and how (are they
one-to-one, one-to-many, or many-to-many relationships). As you determine
this information, you will likely move some fields out of one table and into
another. An example of this might be phone numbers. Many newbies to
databases will be inclined to use the spreadsheet method, and just add a
separate field to their Employees data table for Home_Phone, Work_Phone,
Cell_Phone and be satisfied with that, but a more experienced developer might
create an Employee_Phone_Numbers table so that would contain an ID field
(autonumber), an Employee_ID field (long integer Foreign Key to the
Employee_ID PK field in the Employees table), a Phone_Type_ID field (long
integer Foreign key to the Phone_Type_ID PK field in tbl_Phone_Types), and
finally a Phone_Number field. Using this format, you can add types of phones
(Home, Work, Cell, Pager, ...) and if technology results in a new type of
phone, you just have to add it to tbl_Type_Phones to allow the users to fill
this in.

Reality is that most people don't go to this level of detail in the
requirements process, and the final product looks like it. The biggest
problem I have is that when I build databases at work, the people that want
the database are not generally willing to sit down and define their
requirements, they just give you a general "I want a database to do this"
kind of mission statement, and leave it up to me to figure out what they
want. Then, as they start to use the product, want all sorts of bells and
whistles added on. This frequently results in less than optimal database
design.

If you are developing something that only you will be using, then this is
not a big deal, although poor design can complicate the development effort.
If, on the other hand, you are developing your application for multiple users
or for use at the office, fixing bad design decisions can take significant
effort.

Hope this doesn't sound too dismal. The key, in my mind is doing a thorough
requirement analysis up front.

Dale
--
Email address is not valid.
Please reply to newsgroup only.






- Show quoted text -

Dale, so you have Phone type table? How is this related to phone
number which is in the employee table? Wouldn't you want to record
every phone number that an employee has? I'm confused...
 
D

Dale Fye

Dave,

Have you ever looked at the contacts page in Outlook? They have 4 fields to
display phone numbers, but they have a drop-down list that contains about 19
different types of phone numbers (in an employees database, you might
maintain this list of 19 types in a Phone_Types table). Then, in your
Employee_Phone_Numbers table you would have fields for the Employee_ID,
Phone_Type_ID, and phone number, maybe a separate field for country code and
area code. This table would only contain records for those types of phones
the employee actually has registered, so you might only have 3 numbers (Home,
Cell, Work), or you might have Home-Fax, Work-Fax, Assistant, ....

Outlook also has the same setup for Email addresses, only not so many.

The challenge when you are doing this is designing your forms and reports to
capture and display all of this information.

Hope your head doesn't hurt too much.
 
D

dave.degroot

David,

Good database design takes a thorough requirements analysis process. You
should thoroughly examine what information you want to store in your
database, and then start designing your tables on paper. You need to take
into account such things as do you want to have combo boxes for people to
select from, if so, this might require additional tables to define these
lists (I almost never use Value Lists for my Access databases because they
are too hard to edit).

You also need to identify what information is related and how (are they
one-to-one, one-to-many, or many-to-many relationships). As you determine
this information, you will likely move some fields out of one table and into
another. An example of this might be phone numbers. Many newbies to
databases will be inclined to use the spreadsheet method, and just add a
separate field to their Employees data table for Home_Phone, Work_Phone,
Cell_Phone and be satisfied with that, but a more experienced developer might
create an Employee_Phone_Numbers table so that would contain an ID field
(autonumber), an Employee_ID field (long integer Foreign Key to the
Employee_ID PK field in the Employees table), a Phone_Type_ID field (long
integer Foreign key to the Phone_Type_ID PK field in tbl_Phone_Types), and
finally a Phone_Number field. Using this format, you can add types of phones
(Home, Work, Cell, Pager, ...) and if technology results in a new type of
phone, you just have to add it to tbl_Type_Phones to allow the users to fill
this in.

Reality is that most people don't go to this level of detail in the
requirements process, and the final product looks like it. The biggest
problem I have is that when I build databases at work, the people that want
the database are not generally willing to sit down and define their
requirements, they just give you a general "I want a database to do this"
kind of mission statement, and leave it up to me to figure out what they
want. Then, as they start to use the product, want all sorts of bells and
whistles added on. This frequently results in less than optimal database
design.

If you are developing something that only you will be using, then this is
not a big deal, although poor design can complicate the development effort.
If, on the other hand, you are developing your application for multiple users
or for use at the office, fixing bad design decisions can take significant
effort.

Hope this doesn't sound too dismal. The key, in my mind is doing a thorough
requirement analysis up front.

Dale
--
Email address is not valid.
Please reply to newsgroup only.






- Show quoted text -

Dale, thanks for your post... the phone_type makes sense, however
would you want to include a number of fields for the different phone
numbers... phone_type_1_num, phone_type_2_num, etc.?
 
D

dave.degroot

The biggest step is to make sure that the database is normalised.
Look it up online, there are lots of examples. You could also post
your table structures here and we would be glad to give you a helping
hand.

Ex.
Employees:
EmployeeID - Autonumber
EmployeeName - Text

Jobs:
JobID - Autonumber
JobNumber - Number
ItemID - Number

EmployeeJob:
EmployeeID - AutoNumber
JobID - Number
Duration - Number




- Show quoted text -

Thanks, Dale for your post. Would you recommend having a number of
different fields though for the phone numbers? like "phone_1_numb",
"phone_2_numb" etc, and each one connected to the phone_type_tbl?
 
D

darrin.wilson

How do you guys go about with your table design... how do you make
sure that it's right before proceding with the implementation/coding?

Any pointers for a beginner? I've taken a class, but it's still a
painful process... Just wondering what you all think about this...

Thanks!

David

I sit down and write everything out and find common elements in the
required fields. If you have 4 tables with the same name then that is
one area you can combine. Keep doing that until you cannot find any
other common elements. When you are finished you need to look it over
and find the easiest way to reference the data; you might use a serial
number, employee ID, or a different field but it must be sensible.

Good luck
 
J

Jason Lepack

David,

-- Dale, so you have Phone type table? How is this related to phone
-- number which is in the employee table? Wouldn't you want to record
-- every phone number that an employee has? I'm confused...

Well hopefully this will ease the confusion...

Employee:
EmployeeID - AutoNumber
EmployeeName
etc

PhoneType:
PhoneTypeID - Autonumber
PhoneTypeName

EmployeePhoneNumber:
EmployeeID - FK (relates to Employee.EmployeeID)
PhoneTypeID - FK (relates to PhoneType.PhoneTypeID)
PhoneNumber

Cheers,
Jason Lepack
 
S

Steve

I have developed a proprietary method for mapping the tables. A map of the
tables shows all the tables, all the fields in each table, the relationships
between all the tables and the type of each relationship. In the process of
developing a map, faulty table design becomes readily apparent. When the map
is complete, I take the time to analyze the structure of the tables in the
database looking for errors in the design and also better design.

When the map is complete, I keep it at my right hand as a reference as I
design the database. In the process of designing the database, I may also
tweak the design of the tables making notes on the map. At the end, I revise
the database for all notes and the map becomes documentation for the
database.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
D

dave.degroot

David,

-- Dale, so you have Phone type table? How is this related to phone
-- number which is in the employee table? Wouldn't you want to record
-- every phone number that an employee has? I'm confused...

Well hopefully this will ease the confusion...

Employee:
EmployeeID - AutoNumber
EmployeeName
etc

PhoneType:
PhoneTypeID - Autonumber
PhoneTypeName

EmployeePhoneNumber:
EmployeeID - FK (relates to Employee.EmployeeID)
PhoneTypeID - FK (relates to PhoneType.PhoneTypeID)
PhoneNumber

Cheers,
Jason Lepack




- Show quoted text -

Yes, that does help. Thanks.
 
D

dave.degroot

I have developed a proprietary method for mapping the tables. A map of the
tables shows all the tables, all the fields in each table, the relationships
between all the tables and the type of each relationship. In the process of
developing a map, faulty table design becomes readily apparent. When the map
is complete, I take the time to analyze the structure of the tables in the
database looking for errors in the design and also better design.

When the map is complete, I keep it at my right hand as a reference as I
design the database. In the process of designing the database, I may also
tweak the design of the tables making notes on the map. At the end, I revise
the database for all notes and the map becomes documentation for the
database.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)







- Show quoted text -

Hmm, that makes sense. Sometimes the whole process overwhelms me a
bit when working with large databases and complex ones...
 
D

dave.degroot

David,

-- Dale, so you have Phone type table? How is this related to phone
-- number which is in the employee table? Wouldn't you want to record
-- every phone number that an employee has? I'm confused...

Well hopefully this will ease the confusion...

Employee:
EmployeeID - AutoNumber
EmployeeName
etc

PhoneType:
PhoneTypeID - Autonumber
PhoneTypeName

EmployeePhoneNumber:
EmployeeID - FK (relates to Employee.EmployeeID)
PhoneTypeID - FK (relates to PhoneType.PhoneTypeID)
PhoneNumber

Cheers,
Jason Lepack




- Show quoted text -

I've never seen a EmployeePhoneNumber table before in a database but
that makes sense. Thanks!
 
D

Dale Fye

Dave,

Although I didn't create this one, I have one database that I work with that
contains over 800 tables. This is a warfighting simulation that contains all
sorts of data for every aspect of a multi-service warfight. 500 of the
tables are data that feed the simulation (contain information that it needs
to run properly and to make sure all the aspects of the simulation run
correctly), the other 300 tables describe the output of various aspects of
the simulation.

It is great fun!!!!

Dale
 
C

Christy Wyatt

I'm a beginner too, but I've gotten really indepth lately. My users are
extremely unsophisticated so they are very poor at communicating what they
want. What I do is ask them what reports they are generating already by
other means, such as Word, Spreadsheets, logbooks etc. that relate to the
process they are trying to simplify. I ask them what they like and don't
like about the processes they use now, such as questions they would like to
answer but cannot with the information in the current formats. My tables and
forms closely mimic what they are keeping now, but I build in fields that I
use for relationships.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top