Re: circular relationships ok?

From: Marshall Spight <marshall.spight_at_gmail.com>
Date: 2 Mar 2006 18:51:01 -0800
Message-ID: <1141354261.916925.119110_at_j33g2000cwa.googlegroups.com>


Gene Wirchenko wrote:
> On 2 Mar 2006 15:35:41 -0800, "Marshall Spight" wrote:
> >
> >Okay. Let me adjust my phrasing:
> >
> >If that is the business rule, then are not Invoices and Orders
> >the same SQL table?
>
> They might be, but need not be. 1-1 relationships are possible.
> Again, consider husband and wife.

I'm not getting it. If we're talking about husband and wife in a context in which there is exactly one-for-one always, then we are talking about a table of married people. In which case, why wouldn't I have HusbandBirthday, WifeBirthday, etc.? In fact, I don't really see how the particular domain is even relevant; one can use cardinality relationships alone to make these decisions. If we didn't, we could just as well split every table of n attributes into n tables; the attributes are one-for-one after all.

> I think the example is somewhat artificial.

Agreed.

> In the system that I
> support at work, in general, an invoice has exactly one work order,
> but a work order has UP TO one invoice. (The work order has been
> invoiced, or it has not been invoiced.)

Yes, that seems much more realistic. :-)

Marshall Received on Fri Mar 03 2006 - 03:51:01 CET

Original text of this message