Re: Relation problem

From: Michel <microworld_at_sympatico.ca>
Date: Mon, 29 Jan 2001 19:19:58 GMT
Message-ID: <ynjd6.147884$JT5.5305646_at_news20.bellglobal.com>


This sounds like you are putting the partyID into the person table OR the org table. So a person needs a party or an Org needs a party. So if a person has 2 addresses then you have to create the person twice with a different partyID. Not feaseable.

Michel

Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl> wrote in message news:94t111$f77$1_at_news.tue.nl...
> wrote:
> > On 26 Jan 2001 13:03:09 GMT, hidders_at_REMOVE.THIS.win.tue.nl (Jan
> > Hidders) wrote:
> >
> > >Sure, but then you are dropping the constraint the the Organization
> > >table is the union of the two "subtables". That's fine as long as you
> > >are clear about what every tuple in every table means.
> >
> > The Organization table isn't the union of anything.
>
> No, not exactly, of course. But the projection of the Parties table on
> the PartyID column is the union of the projection of Organizations
> table on the OrgID column and the projection of the Persons table on
> the PersonID column. (But only after renaming the columns appropriately
> of course.) My apologies for being a bit sloppy before, but I thought
> that would be clear from the context since I already had made the same
> point before.
>
> > Do you *know* what a supertype is? Judging by your contribution to
> > this thread, I'd have to say you don't. It looks like you're just
> > throwing words around.
>
> *sigh* Yes, I know what a supertype is, I have been teaching the
> concept in ER, NIAM and UML and it plays a part in my PhD research.
>
> > Maybe these bite-sized pieces of SQL will help.
>
> By now I hope that you understand that I am missing the following
> constraint in your SQL:
>
> ALTER TABLE Parties
> ADD CONSTRAINT AbstractClass
> CHECK (
> EXISTS (
> SELECT * FROM Persons WHERE Persons.PersonID = Parties.PartyID
> )
> OR
> EXISTS (
> SELECT * FROM Organizations WHERE Organizations.OrgID =
 Parties.PartyID
> )
> )
>
> Note that I already said that it is perfectly OK to omit this
> constraint if you know what it means to have a Party that is neither an
> Organization nor a Person. But since that wasn't stated in the original
> problem you cannot tacitly assume that.
>
> So. I hope this clears up any misunderstandings because it seems to me
> a very silly thing to get argumentative about. But usenet sometimes
> does that to people. :-)
>
> Kind regards,
>
> --
> Jan Hidders
Received on Mon Jan 29 2001 - 20:19:58 CET

Original text of this message