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 |
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2006-09-06 : 13:22:46
|
| HiI wonder what the prefered way to build a database would be, when looking at theese 2 types...1. Build 1 table with columns like this..ID Author Book1 Book2 Book3 and so onOr this way...2.Build 2 tables like this..table 1.ID Authortable 2.ID BooksIf the author have several books associated with him the second model must be the preferable, but what if there only will be one. Does it really matter then?Regards |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2006-09-06 : 13:39:16
|
| Option 1 is not normalized, so it's not the way to go. You can't make assumptions about having only one book. Option 2 looks better, but we'd need more details in order to tell you that the design is correct.Tara Kizer |
 |
|
|
magmo
Aged Yak Warrior
558 Posts |
Posted - 2006-09-06 : 15:03:33
|
| HiThanks for the info, I'll stick with the second option then.Regards |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-09-06 : 22:19:05
|
| Homework?CODO ERGO SUM |
 |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2006-09-06 : 23:53:49
|
| You might want to consider a third table with bookID & authorID. With what you describe you can only have one author per book (assuming table 2 also has authorID). |
 |
|
|
|
|
|