Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Relation problem

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@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 Fri Jan 26 2001 - 17:25:21 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US