| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> help for mapping unary entity and relation
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 - CanadaReceived on Tue Apr 16 2002 - 10:08:53 CDT
![]() |
![]() |