dbTalk Databases Forums  

design question

comp.databases comp.databases


Discuss design question in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dba
 
Posts: n/a

Default design question - 03-19-2008 , 07:21 PM






When or why does one make the decision to create a table instead of just
entering the data. Example ..... zip codes or this day in age phones.
Home phone, work phone, cell phone 1, cell phone2 ..... Create a phone
table no?

Reply With Quote
  #2  
Old   
Post.Philipp@googlemail.com
 
Posts: n/a

Default Re: design question - 03-20-2008 , 04:15 AM






Hi,

This is called normalization. Imagine a table with Persons and their
Addresses. If you just create separate columns HomePhone, WorkPhone,
CellPhone1, CellPhone2 you will certainly come to a point where
somebody does have three cell phones. Where to store that then? Always
creating new columns is a design you would apply for a Spreadsheet but
a database has a totally different concept. You would also run into a
complete nightmare when you try to query such spreadsheet design
data.

You would be better if you create a separate table PhoneNumbers and
have columns like PhoneType and PhoneNumber.

Zip codes might not require a separate table if you just want to store
one by address, but as you did not gave more specs it is difficult to
comment on this.

brgds

Philipp Post



Reply With Quote
  #3  
Old   
Post.Philipp@googlemail.com
 
Posts: n/a

Default Re: design question - 03-20-2008 , 04:15 AM



Hi,

This is called normalization. Imagine a table with Persons and their
Addresses. If you just create separate columns HomePhone, WorkPhone,
CellPhone1, CellPhone2 you will certainly come to a point where
somebody does have three cell phones. Where to store that then? Always
creating new columns is a design you would apply for a Spreadsheet but
a database has a totally different concept. You would also run into a
complete nightmare when you try to query such spreadsheet design
data.

You would be better if you create a separate table PhoneNumbers and
have columns like PhoneType and PhoneNumber.

Zip codes might not require a separate table if you just want to store
one by address, but as you did not gave more specs it is difficult to
comment on this.

brgds

Philipp Post



Reply With Quote
  #4  
Old   
Post.Philipp@googlemail.com
 
Posts: n/a

Default Re: design question - 03-20-2008 , 04:15 AM



Hi,

This is called normalization. Imagine a table with Persons and their
Addresses. If you just create separate columns HomePhone, WorkPhone,
CellPhone1, CellPhone2 you will certainly come to a point where
somebody does have three cell phones. Where to store that then? Always
creating new columns is a design you would apply for a Spreadsheet but
a database has a totally different concept. You would also run into a
complete nightmare when you try to query such spreadsheet design
data.

You would be better if you create a separate table PhoneNumbers and
have columns like PhoneType and PhoneNumber.

Zip codes might not require a separate table if you just want to store
one by address, but as you did not gave more specs it is difficult to
comment on this.

brgds

Philipp Post



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.