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: circular relationships ok?

Re: circular relationships ok?

From: David Portas <REMOVE_BEFORE_REPLYING_dportas_at_acm.org>
Date: 2 Mar 2006 08:50:57 -0800
Message-ID: <1141318257.897955.150140@v46g2000cwv.googlegroups.com>


Let's try an even simpler and even more common example: An organizational hierarchy.

CREATE TABLE Employees
 (employee_id INTEGER PRIMARY KEY,
 employee_name VARCHAR(50) NOT NULL,
 manager_id INTEGER NOT NULL
  REFERENCES Employees (employee_id),
  CHECK (employee_id =0 OR employee_id <> manager_id));

The business rule is that each employee has a manager who is also an employee.

--
David Portas
Received on Thu Mar 02 2006 - 10:50:57 CST

Original text of this message

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