-
Hi,
I have a recursive relationship with many to many as follows. Employee table. An employee may be supervised by many other employee and an employee may supervise many other employees. How do I implement this business requirement.
Please give me your ideas.
Thanks,
Ramesh
-
There is a resolution entity, call it MGR_EMP. It has two columns, MGR_ID and EMP_ID. Both have FKs to the EMP_ID in the EMP table.
An employee has 0 or many MGR_EMP relations and an employee manages through 0 or many MGR_EMP relations.
-
U should create to tables:
1 EMP_TABLE
(
emp_id number(..) primary key,
..
)
2. XREF_EMPS
(
emp_id number(..),
emp_xr number(..)
)
This is standart decision for recurcive (or graph) relationship (N x M) in 1 table.
-
Thank you both David and Shestakov.
Ramesh