Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Help: Cross-Referenced Foreign Keys
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