One to One Relationship

B

boaz

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] chain, the third table
will have 3 columns as the key -- "company id", "employee id", and "sale
id".


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]

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top