You are here: One-One Relationship « MsSQL Server « IT news, forums, messages
One-One Relationship

Posted by Tom on 10/10/05 20:13

Hi,


Do you guys know what's wrong with a one-to-one relationship?

The reason I want to make it like this is that at the very end of the chain,
the set of keys is huge. I want to limit the number of columns to be the
key. i.e. the [company] table has 1 column as the key. The [employee]
table will have 2 columns as the key.

e,g,
If I add a [sale] table to the [company]-[employee] relationship, the third
table
will have 3 columns as the key -- "company id", "employee id", and "sale
id".

(e.g.)
I have a company with many employees and computers. But instead of classify
all these, I just want to call all these as an entity. A company is an
entity. An employee is just another entity. etc.

So, instead of a one-to-many:
[company]---*[employee]---*[sale]
|
|
*
[computer]

I make it one-to-one.

[entity]---*[entity]

If I want to know the name and address of the entity "employee", I will have
a 1-to-1 table [employee] to look up the information for this employee
entity.

[entity]---*[entity]
|
|
[company]
|
|
[employee]
|
|
[computer]
|
|
[sale]


--
> There is no answer.
> There has not been an answer.
> There will not be an answer.
> That IS the answer!
> And I am screwed.
> Deadline was due yesterday.
>
> There is no point to life.
> THAT IS THE POINT.
> And we are screwed.
> We will run out of oil soon.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация