Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Help: Cross-Referenced Foreign Keys

Help: Cross-Referenced Foreign Keys

From: Chuck Price <c_price_at_interaccess.com>
Date: Sat, 12 Dec 1998 15:19:45 GMT
Message-ID: <36727f26.128199532@news.interaccess.com>


Two tables: Staff & Department. I'll show only the fields I need to discuss:

create table Staff (
  StaffNo number not null primary key,
  Dept number not null,
    foreign key (Dept) references Department(Dept)
);

create table Department (
  Dept number not null primary key,
  Manager number,
    foreign key (Manager) references Staff(StaffNo)
);

In this case, each staff must be assigned a department and each department may be assigned a manager (who must exist in the Staff table if assigned).

As a new user of Oracle, I'm having trouble implementing this.

Any ideas are appreciated.

There is no underscore in my email address. That's for our spamming friends.

Thanks in advance! Received on Sat Dec 12 1998 - 09:19:45 CST

Original text of this message

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