Re: circular relationships ok?

From: David Portas <>
Date: 2 Mar 2006 08:50:57 -0800
Message-ID: <>

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

 (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 - 17:50:57 CET

Original text of this message