Académique Documents
Professionnel Documents
Culture Documents
Street
56 Clover Dr
163 Main St
32 Manse Rd
22 Deer Rd
16 Argyll St
Client
No
CR56
Fna
me
Aline
CR62
Mary
CR74
Mike
CR76
John
Owner
No
CO40
Fna
me
Sam
CO46
Joe
CO87
Coral
CO93
Tony
City
London
Glasgow
Los Angeles
London
Aberdeen
Client
Lnam
TelNo
e
Stewa 014184818
rt
25
Trege
012241967
ar
20
014753921
78
Kay
020777456
32
PrivateOwner
Lna
Address
me
Spad 63 Well St,
e
Glasgow
Keog 2 Fergus Dr,
h
Aberdeen
Farrel 6 Achray St,
Glasgow
Shaw 12 Park Pl,
Glasgow
Propert
Street
yNo
PA14
16
Holhead
PG16
5 Novar
Dr
Postcode
NW10 6EU
G11 9QX
BS99 1NZ
SW1 4EH
AB2 3SU
PrefTy
pe
Flat
MaxRe
nt
350
Villa
600
House
750
Flat
425
TelNo
01419431
728
01224861
212
01413577
419
01412257
025
PropertyForRent
City
Postc Typ Roo
ode
e
ms
Aberde AB7
Hou
6
en
5SU
se
Glasgo G12
Flat
4
w
9AX
Re Owner Staf
nt
No
No
65 CO46
SA9
0
45 CO93
SG14
0
Branc
hNo
B007
B003
PG21
PG36
PG4
PL94
18 Dale
Rd
2 Manor
Rd
6
Lawrence
6 Argyll
St
Glasgo
w
Glasgo
w
Glasgo
w
Londo
n
G12
G32
4QX
G11
9QX
NW2
Hou
se
Flat
Villa
Villa
StafN
o
SA9
Fnam
e
Mary
Lnam
e
Howe
SG14
David
Ford
SG37
Ann
Beech
SG5
Susan
Brand
SL21
John
White
Staf
Position Gende
r
Assistant Femal
e
Superviso Male
r
Assistant Femal
e
Manager
Femal
e
Manager
Male
SL41
Julie
Lee
Assistant
Femal
e
60
0
37
5
35
0
40
0
CO87
SG37
B003
CO93
SG37
B003
CO40
SG29
B003
CO87
SL41
B005
DOB
Salar Branch
y
No
19-Feb- 9000 B007
00
24-Mar- 1850 B003
08
0
11-Oct- 1240 B003
06
0
03-Jun-12 4400 B003
0
01-Oct- 3000 B005
15
0
13-Jun-05 8700 B005
This is a sample database for a certain Property dealing company. Now do the following queries.
1. Create all the tables mentioned above and following is the list of constraints for all the
tables:
Branch
BranchNo
PRIMARY KEY
PostCode
UNIQUE KEY
Client
ClientNo
PRIMARY KEY
TelNo
UNIQUE KEY
MaxRent
Value should be at least 0.
PrivateOwner
OwnerNo
PRIMARY KEY
TelNo
UNIQUE KEY
Address
NOT NULL
Fname
NOT NULL
Lname
NOT NULL
PropertyForRent
PropertyNo
PRIMARY KEY
OwnerNo
FOREIGN KEY
StafNo
FOREIGN KEY
BranchNo
FOREIGN KEY
Staf
StafNo
BranchNo
PRIMARY KEY
FOREIGN KEY