Re: Relation problem

From: Jan Hidders <hidders_at_REMOVE.THIS.win.tue.nl>
Date: 26 Jan 2001 23:25:21 GMT
Message-ID: <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 Sat Jan 27 2001 - 00:25:21 CET

Original text of this message