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)
 Table design question

Author  Topic 

vgurgov
Starting Member

12 Posts

Posted - 2006-11-15 : 20:46:04
Hello,

I have the following situation...

I have a table called Person. Every "Person" can have one or more Names. Only one name is required, which becomes the primary Name. The rest will become secondary, and will be optional.

I know I'll need to have 2 tables and I have 2 options of creating these 2 tables.

First approach can contain the primary Name in table Person, and have all secondary names in table SecondaryNames. Second option is to have the Person table without a Name, and have all (primary and secondary) names in the second table for Names. For the second approach, I will need to have another column which will specify which Name is primary (right?).

Which of these two approaches is better? Or maybe you can suggest something else...?

The table Person will have about 2000 records with about 15 other attributes. I would say about 5-10% of these records will have 1-2 secondary names.

Thanks in advance,
vgurgov

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2006-11-15 : 20:52:18
Since the primary name is required, I would keep it in the Person table as a NOT NULL column.

that way you don't need to do anything special to enforce the rule that the primary name is required. also, depending on your usage, you'll have less joins to do.


SqlSpec - a fast, cheap, and comprehensive data dictionary generator for
SQL Server 2000/2005 and Analysis Server 2005 - http://www.elsasoft.org
Go to Top of Page
   

- Advertisement -