| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Theory Question--Two tables relating in more than one way?
On 1 Mar 2005 08:25:34 -0800, -CELKO- wrote:
>>> Also, is it a design flaw to have two tables related in more than
>one way? Does it violate TNF? <<
>
>No. But you need to be careful about cycles. I am having a hard time
>coming up with a reasonable example, tho.
Hi Joe,
Wouldn't the classic "employee-worksfor-department / department-ismanagedby-employee" example work?
CREATE TABLE Employees
(SSN char(9) NOT NULL PRIMARY KEY
,FullName varchar(60) NOT NULL
,DeptCode char(3) NOT NULL);
CREATE TABLE Departments
(DeptCode char(3) NOT NULL PRIMARY KEY
,DeptName varchar(25) NOT NULL UNIQUE
,Manager char(9) NOT NULL REFERENCES Employees(SSN));
ALTER TABLE Employees
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)Received on Tue Mar 01 2005 - 14:01:27 CST
![]() |
![]() |