Re: 1-1 relationships
Date: Sun, 10 Dec 2000 07:51:39 -0500
Message-ID: <k%KY5.10444$WB1.46553_at_newscontent-01.sprint.ca>
Thoughts:
1. Are the two entity types different because they have different key
attributes? If you implement a combined table, the key needs to be bent to
fit.
2. Are the two entity types different because they have different
relationships? Say Entity 1 (E1) and Entity 2 (E2) are 1:1. E1 is also
related to E3, and E2 is also related to E4. If E1 and E2 are implemented as
one table, their keys are carried in both E3 and E4. This gives the false
impression that E1 related to E4, likewise that E2 is related to E3.
Some programmers will insist you build just one table to keep things 'simple'. Later they'll find some unintended use for the bogus relationships, sooner or later it's bound to happen. The single, simple table won't seem so simple.
Let me know what you think.
"Angus Monro" <ajmonro_at_ingennia.com.au> wrote in message
news:3A25D8A1.4A66819D_at_ingennia.com.au...
> Given that two types of entities have a one-to-one relationship, are
> there any good reasons for mapping them to two distinct tables with
> appropriate foreign-key relationships, versus mapping them into a single
> table? The theoretical side of me wants to keep them in distinct
> tables, but I can't see the point of the extra space overhead and the
> time overhead incurred by needing to do joins betweeen them when
> querying.
>
> Angus Monro.
>
Received on Sun Dec 10 2000 - 13:51:39 CET