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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 DB design advice

Author  Topic 

magmo
Aged Yak Warrior

558 Posts

Posted - 2006-09-06 : 13:22:46
Hi

I 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 on

Or this way...

2.
Build 2 tables like this..

table 1.

ID Author

table 2.

ID Books

If 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
Go to Top of Page

magmo
Aged Yak Warrior

558 Posts

Posted - 2006-09-06 : 15:03:33
Hi

Thanks for the info, I'll stick with the second option then.

Regards
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-09-06 : 21:02:27
Also read about normalisation
http://www.datamodel.org/NormalizationRules.html


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-09-06 : 22:19:05
Homework?

CODO ERGO SUM
Go to Top of Page

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).
Go to Top of Page
   

- Advertisement -