forked from aayushi-2003/DreamHouse-DBMS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforeignKey.sql
39 lines (26 loc) · 1.12 KB
/
foreignKey.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
alter table staff
add foreign key(Branch_Number) references Branch(Branch_Number);
alter table Manager
add foreign key(staff_number) references staff(staff_number);
-- alter table Supervisor
-- add foreign key(staff_number) references staff(staff_number);
alter table Assistant
add foreign key(staff_number) references staff(staff_number);
alter table Property
add foreign key(Managed_By) references staff(staff_number);
alter table Property
add foreign key(Owner_Num) references Owner(Owner_Number);
alter table Property
add foreign key(Registered_At_Branch) references Branch(Branch_Number);
alter table Client
add foreign key(Branch_Number) references Branch(Branch_Number);
alter table Client
add foreign key(Registered_By_Staff) references staff(staff_number);
alter table Lease
add foreign key(Client_Number) references Client(Client_Number);
alter table Lease
add foreign key(Property_Number) references Property(Property_Number);
alter table Property_Report
add foreign key(Property_Number) references Property(Property_Number);
alter table Property_Report
add foreign key(Client_Number) references Client(Client_Number);