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

Home -> Community -> Usenet -> comp.databases.theory -> help for mapping unary entity and relation

help for mapping unary entity and relation

From: Yves Guerin <yves.guerin_at_muhc.mcgill.ca>
Date: Tue, 16 Apr 2002 15:08:53 GMT
Message-ID: <98Xu8.2053$%i2.1300228@carnaval.risq.qc.ca>


Hello,

I would like to know on howto map the unary relationship, because I read something and I get confuse:

Ex 1: employee <--- 1 ---> married to <---- 1 ----> employee so I do the mapping like this:
- include primary key as foreign key in the Employee entity, include any
attributs form the relation into the Employee entity True OR False ?

Ex 2: parts <--- M ---> contain <--- N ---> parts so I do the mapping like this
- include primary key as foreign key in the Parts entity, include any
attributs form the relation into the Parts entity True OR False ?

So relationship 1:M or 1:1 are the same mapping for a unary relationship (see examples above), but If I do a sql: SELECT * FROM Employee WHERE id = e1;
I get (as example) e1 - e2.
for my second example I do the following sql: SELECT * FROM Parts WHERE id= p1;
I get (as example) p1 - p2, p1 - p3, p1 - p4.

so I am in the wrong way or in the good path ?

Regards

Yves

--
Yves Guerin
CUSM-MUHC
Groupe Interfaces
Montreal - Canada
Received on Tue Apr 16 2002 - 10:08:53 CDT

Original text of this message

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