Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 26

Branch

Relation schema
Branch (BranchNo, Street, Area, City, Postcode, TelephoneNo,
FaxNo, ManagerStaffNo, ManagerStartDate, BonusPayment,
CarAllowance)

Primary Key
BranchNo

Alternate Keys
TelephoneNo
FaxNo

Foreign Key
ManagerStaffNo references Staff (StaffNo) on delete SET NULL on
update CASCADE

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
BranchNo Uniquely 3 B followed by Yes
identifies variabl integer from 1-99
branch e
office charact
er
Street Street of 25 Yes
branch variabl
address e
charact
er

Dream Home Data Dictionary


Area Area of 15 No
branch variabl
address e
charact
er
City City of 15 Yes
branch variabl
address e
charact
er
Postcode Postcode of 8 No
branch variabl
address e
charact
er
Telephone Telephone 13 No
No number of variabl
branch e
charact
er
FaxNo Fax number 13 No
of branch variabl
e
charact
er
ManagerSt Staff 5 Same as Staff No
affNo number of variabl (StaffNo)
branch e
manager charact
er
ManagerSt Date Date No
artDate manager
started at
branch

Dream Home Data Dictionary


BonusPay Manager’s Curren No
ment monthly cy
bonus
payment
CarAllowa Manager’s Curren No
nce annual car cy
allowance

Enterprise constraints
None

Dream Home Data Dictionary


Staff

Relation schema
Staff (StaffNo, FirstName, LastName, Address, TelephoneNo, Sex,
DateOfBirth, Position, Salary, DateJoined, NationalInsuranceNo,
TypingSpeed, BranchNo

Primary Key
StaffNo

Alternate Key
NationalInsuranceNo

Foreign Key
BranchNo references Branch (BranchNo) on delete NO ACTION on
update CASCADE

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
StaffNo Uniquely 5 S, followed by Yes
identifies a variabl letter denoting
member of e branch, followed
staff charact by number from
er 1-999
FirstName First name 20 Yes
of staff variabl
e
charact
er
LastName Last name 20 Yes
of staff variabl
e
charact
er

Dream Home Data Dictionary


Address Full home 50 Yes
address of variabl
staff e
member charact
er
Telephone Home 13 No
No telephone variabl
of staff e
member charact
er
Sex Gender of 1 fixed Allowable values Yes
staff charact ‘M’ or ‘F’
er
DateOfBirt Date of Date No
h birth of
staff
Position Position of 20 Allowable values Yes
staff variabl ‘Manager’,
member e ‘Supervisor’,
charact ‘Deputy’,
er ‘Assistant’,
‘Secretary’
Salary Salary of Curren Yes
staff cy
member
DateJoined Date staff Date Yes
member
joined
DreamHom
e
NationalIns National 10 Yes
uranceNo Insurance variabl
Number of e
staff charact
er

Dream Home Data Dictionary


TypingSpe Typing Integer Applies only to No
ed speed in staff with position
words per ‘Secretary’
minute
BranchNo Branch staff 3 As for Branch Yes
member variabl (BranchNo)
works at e
charact
er

Enterprise constraints
None

Dream Home Data Dictionary


Next Of Kin

Relation schema
NextOfKin (StaffNo, NextOfKinName, Relationship, Address,
TelephoneNo)

Primary Key
StaffNo, NextOfKinName

Foreign Key
StaffNo references Staff (StaffNo) on delete CASCADE on update
CASCADE

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
StaffNo Staff 5 As for Staff Yes
member variabl (StaffNo)
who next of e
kin is charact
related to er
NextOfKin Full name 30 Yes
Name of next of variabl
kin e
charact
er
Relationshi Relationshi 20 No
p p of next of variabl
kin to staff e
charact
er

Dream Home Data Dictionary


Address Full home 50 No
address of variabl
next of kin e
charact
er
Telephone Home 13 No
No telephone variabl
of next of e
kin charact
er

Enterprise constraints
None

Dream Home Data Dictionary


Allocated Staff

Relation schema
AllocatedStaff (SuperviseeStaffNo, SupervisorStaffNo,
SecretaryStaffNo)

Primary Key
SuperviseeStaffNo

Foreign Key
SuperviseeStaffNo references Staff (StaffNo) on delete CASCADE
on update CASCADE
SupervisorStaffNo references Staff (StaffNo) on delete SET NULL
on update CASCADE
SecretaryStaffNo references Staff (StaffNo) on delete SET NULL on
update CASCADE

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
Supervisee Staff 5 As for Staff Yes
StaffNo number of variabl (StaffNo)
supervisee e
charact
er
Supervisor Staff 5 As for Staff Yes
StaffNo number of variabl (StaffNo)
supervisor e
charact
er
SecretarySt Staff 5 As for Staff Yes
affNo number of variabl (StaffNo)
secretary to e
workgroup charact
er

Dream Home Data Dictionary


Enterprise constraints
 A supervisor may supervise a minimum of five and a maximum
of ten members of staff, at any one time.
 A secretary may support one or more workgroups at the same
branch (not in text)
 A supervisee may be in only one workgroup at a time.

Dream Home Data Dictionary


Property For Rent

Relation schema
PropertyForRent (PropertyNo, Street, Area, City, Postcode, Type,
Rooms, Rent, PrivateOwnerNo, BusinessOwnerNo, StaffNo,
BranchNo, Picture, Comments, Withdrawn, DeleteRecord)

Primary Key
PropertyNo

Foreign Keys
OwnerNo references PrivateOwner (OwnerNo) and BusinessOwner
(OwnerNo) on delete NO ACTION on update CASCADE
StaffNo references Staff (StaffNo) on delete SET NULL on update
CASCADE
BranchNo references Branch (BranchNo) on delete SET DEFAULT
on update CASCADE

Attributes
Name Description
Data Domain Requi Defa
type characteristics red ult
and valu
length e
PropertyNo Unique 5 P, followed by Yes
identifier for variabl letter indicating
a property e city, followed by
charac number from 1-
ter 999
Street Street of 25 Yes
property variabl
address e
charac
ter

Dream Home Data Dictionary


Area Area or 15 No
suburb of variabl
property e
address charac
ter
City City of 15 Yes
property variabl
address e
charac
ter
Postcode Postcode of 8 No
property variabl
address e
charac
ter
Type Code 1 fixed Allowable Yes F
describing charac values:
type of ter B (bungalow), C
property (cottage), D
(detached), E
(end-terrace), F
(flat) M (mid-
terrace), S (semi-
detached)
Rooms Number of Integer Allowable range No 4
rooms in 1-15
property
(excluding
bathroom(s)
)
Rent Monthly Curren No 600
rent of cy
property

Dream Home Data Dictionary


PrivateOwn Owner 5 As for No
erNo number of variabl PrivateOwner
private e (OwnerNo)
owner of the charac
property ter
BusinessO Owner 5 As for No
wnerNo number of variabl BusinessOwner
business e (OwnerNo)
owner of the charac
property ter
StaffNo Staff 5 As for Staff No
number of variabl (StaffNo)
staff e
member charac
responsible ter
for
managing
the property
BranchNo Branch 3 As for Yes
number of variabl Branch(BranchN
branch e o)
property is charac
registered at ter
Picture Picture of Graphi No
property c

Comments Comments 255 No


about variabl
property e
charac
ter
*Withdraw Date Date No
n property
was
withdrawn
from
available list

Dream Home Data Dictionary


*DeleteRec Confirm Yes/ No
ord deletion of No
record

Enterprise constraints
 A member of staff may supervise a maximum of ten properties for
rent at any one time.
 The monthly rent for a property should be reviewed annually
 Property records are kept for at least three years after being
withdrawn from rental and may then be deleted

Notes
Attributes marked with * have been added to those listed in textbook

Dream Home Data Dictionary


Private Owner

Relation schema
PrivateOwner (PrivateOwnerNo, FirstName, LastName, Address,
TelephoneNo)

Primary Key
PrivateOwnerNo

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
PrivateOw Uniquely 5 CO followed by Yes
nerNo identifies a variabl number from 1-
private e 999
owner charact
er
FirstName First name 20 Yes
of owner variabl
e
charact
er
LastName Last name 20 Yes
of owner variabl
e
charact
er
Address Full address 50 Yes
of owner variabl
e
charact
er

Dream Home Data Dictionary


Telephone Home 13 No
telephone variabl
number of e
owner charact
er

Enterprise constraints
None

Dream Home Data Dictionary


Business Owner

Relation schema
BusinessOwner (BusinessOwnerNo, BusinessName, BusinessType,
Address, TelephoneNo, ContactName)

Primary Key
BusinessOwnerNo

Alternate Key
TelephoneNo

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
BusinessO Uniquely 5 CB followed by Yes
wnerNo identifies a variabl number from 1-
business e 999
owner charact
er
BusinessNa Name of 30 Yes
me business variabl
e
charact
er
BusinessTy Type of 20 Yes
pe business variabl
e
charact
er
Address Full address 50 Yes
of business variabl
e
charact
er

Dream Home Data Dictionary


Telephone Telephone 13 Yes
number of variabl
business e
charact
er
ContactNa Full name 30 No
me of contact variabl
person in e
business charact
er

Enterprise constraints
None

Dream Home Data Dictionary


Lease Agreement

Relation schema
LeaseAgreement (LeaseNo, RenterNo, PropertyNo, PaymentMethod,
Rent, DepositAmount, DepositPaid, RentStart, RentFinish)

Primary Key
LeaseNo

Alternate Key
PropertyNo, RentStart

Foreign Keys
RenterNo references Renter (RenterNo) on delete NO ACTION on
update CASCADE
PropertyNo references PropertyForRent (PropertyNo) on delete NO
ACTION on update CASCADE

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
LeaseNo Uniquely 8 L followed by Yes
identifies variabl letter denoting
lease e branch city
charact followed by
er number from 1-
99999
RenterNo Renter 5 As for Renter Yes
number of variabl (RenterNo)
renter e
involved in charact
lease er

Dream Home Data Dictionary


PropertyNo Property 5 As for Yes
number of variabl PropertyForRent
property e (PropertyNo)
involved in charact
lease er
PaymentM Method of 15 Allowable values: Yes
ethod payment of variabl ‘Cash’, ‘Credit’,
rent e ‘Cheque’,
charact ‘Standing Order’
er
Rent Monthly Curren Yes
rent cy
DepositAm Amount of Curren Yes 2*
ount deposit cy Rent

DepositPai Whether Boolea Allowable values Yes


d deposit has n ‘Yes’, ‘No’
been paid
RentStart Date lease Date Yes
commences
RentFinish Date lease Date Yes
ends

Enterprise constraints
 The length of a lease is from 3 to 12 months
 The deposit amount is twice the monthly rent

Dream Home Data Dictionary


Renter

Relation schema
Renter (RenterNo, FirstName, LastName, Address, TelephoneNo,
PreferredType, MaximumRent, BranchNo)

Primary Key
RenterNo

Foreign Key
BranchNo references Branch (BranchNo) on delete NO ACTION on
update CASCADE

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
RenterNo Uniquely 5 CR followed by a Yes
identifes a variabl number from 1-
renter e 999
charact
er
FirstName First name 20 Yes
of renter variabl
e
charact
er
LastName Last name 20 Yes
of renter variabl
e
charact
er

Dream Home Data Dictionary


Address Full address 50 Yes
of renter variabl
e
charact
er
Telephone Telephone 13 No
No number of variabl
renter e
charact
er
PreferredT Type of 1 fixedAllowable values: No
ype property charactB (bungalow), C
renter er (cottage), D
prefers (detached), E
(end-terrace), F
(flat) M (mid-
terrace), S (semi-
detached)
Maximum Maximum Curren No
Rent monthly cy
rent renter
is prepared
to pay
BranchNo Branch 5 Yes
renter is variabl
registered at e
charact
er

Enterprise constraints
None

Dream Home Data Dictionary


Viewing

Relation schema
Viewing (PropertyNo, RenterNo, DateViewed, Comments)

Primary Key
PropertyNo, RenterNo, DateViewed

Foreign Key
PropertyNo references PropertyForRent (PropertyNo) on delete
CASCADE on update CASCADE
RenterNo references Renter (RenterNo) on delete CASCADE on
update CASCADE

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
PropertyNo Property 5 As for Yes
number of variabl PropertyForRent
property e (PropertyNo)
viewed charact
er
RenterNo Renter 5 As for Renter Yes
number of variabl (RenterNo)
client e
involved in charact
viewing er
DateViewe Date the Date Yes
d property
was viewed
Comments Client's 50 No
comments variabl
on property e
charact
er

Dream Home Data Dictionary


Enterprise constraints
None

Dream Home Data Dictionary


Inspection

Relation schema
Inspection (PropertyNo, StaffNo, DateInspected, Comments)

Primary Key
PropertyNo, StaffNo

Foreign Key
PropertyNo references PropertyForRent (PropertyNo) on delete
CASCADE on update CASCADE
StaffNo references Staff (StaffNo) on delete SET NULL on update
CASCADE

Attributes
Name Description Data Domain Requi Defa
type characteristics red ult
and valu
length e
PropertyNo Property 5 As for Yes
number of variabl PropertyForRent
property e (PropertyNo)
inspected charact
er
StaffNo Staff 5 As for Staff Yes
number of variabl (StaffNo)
staff e
member charact
who er
inspected
property
DateInspec Date Date Yes
ted property
was
inspected

Dream Home Data Dictionary


Comments Comments 255 No
on variabl
condition of e
property charact
er

Enterprise constraints
 Properties should be inspected at least once over a six month
period.

Dream Home Data Dictionary

You might also like