Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-02-13 : 04:32:02
|
| Hi am trying to figure out my table design need some adviceI have a table that catches the telephone numbers of a customer , there are 5 telephones for each customer. All the numbers are there in the DB Should I create the design in the following formatCustomerNameTel1Tel2Tel3Tel4Tel5Or Should I have CustomerTelephone& then have 5 rows for each customer Please adviceI even wanted to knw how should the design be , if all the Tel Nos are not captured, I mean what if some customers have 3 tel Nos, while some may just have 1 while some may have all 5 Thanks |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2006-02-13 : 04:35:34
|
| 2nd option, i think, a join is faster than parsing an n-length of field--------------------keeping it simple... |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-13 : 04:39:49
|
Second is according to Normalisation MadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-02-13 : 05:48:56
|
Second option is the best and it conforms to normalization and does not limit the number of telephone no per customer to 5. And it is much more flexible in your design. If in future you need to identify the type of telephone no (like Mobile No, Work No, Home No etc) you can just easily add a column to identify it.quote: I even wanted to knw how should the design be , if all the Tel Nos are not captured, I mean what if some customers have 3 tel Nos, while some may just have 1 while some may have all 5
The Second option will not have any issue with this.----------------------------------'KH'everything that has a beginning has an end |
 |
|
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-02-13 : 05:55:57
|
| Any comments on space management |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-13 : 07:19:32
|
| Did you mean column size?MadhivananFailing to plan is Planning to fail |
 |
|
|
kid_on_the_block
Posting Yak Master
172 Posts |
Posted - 2006-02-13 : 08:25:23
|
| Sorry that was a wrong question, wouldnt the joins eat up a lot of resources in the fututre, I mean fetching data from one table would be much simplerWhat say |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2006-02-13 : 08:32:57
|
| Properly indexed, joins would not slow the process down or use a lot of resources. SQL Server is designed to work with sets, so it's natural for it to deal with data in this format. |
 |
|
|
|
|
|
|
|