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_at_v46g2000cwv.googlegroups.com>
Date: 2 Mar 2006 08:50:57 -0800
Message-ID: <1141318257.897955.150140_at_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 PortasReceived on Thu Mar 02 2006 - 17:50:57 CET