DB Topic 4
DB Topic 4
DB Topic 4
Topic 4:
Entity Relationship Modelling 2
Learning Outcomes
By the end of this topic, students will be able to:
Construct an ER model from a scenario
Understand the purpose of a primary key
Understand the role of foreign keys
Recognise strong and weak entities
Identify and solve problems in ER models
Solution
Worker Worker skill
skill 1 Skill
1 0...* 0...*
0...*
Lodging
lodging
Attributes - 1
Client
Primary Key ------------
clientNo(PK)
Uniquely identifies each name
occurrence of an entity fname
lname
telNo
Attributes - 2
Client
Foreign Key ------------ Preference
clientNo(PK) -------------
Links entities name prefType
into relationships fname maxRent
lname clientNo(FK)
telNo
Taken by
V
Attributes:
0...*
Student
Student No(PK)
Student Name
0...*
Student Attributes:
on
Module Code (FK)
Module
Student No (FK)
0...*
1 Attributes:
Student No(PK)
Student
Student Name
States>
Client Preference
0...* 1 1 1...*
Staff Campus Department
Fan Traps
Campus ID Campus Name
-1 C1 London
Campus
C2 Lagos
C3 Cairo
S3 Malia C1 D3 Maths C2
Shah
Staff Department
1...* 1 1...* 1
Staff Department Campus
-2 C1 London
Campus
C2 Lagos
C3 Cairo
Chasm Trap - 1
Branch Branch
ID Name
Branch Which Branch manages
1 Ilford
Hill House?
2 Redbridge
Chasm Trap - 2
Branch Branch We now know which
ID Name
Branch Branch manages Hill
1 Ilford
House
2 Redbridge
CAR 1 0...*
HIRE
0...* 1
0...* 1
CUSTOMER
1
0...*
0...* 1
MODEL 1 0...*
RESERVATION
References
Connolly, T. & Begg, C. (2004). Database
Systems: A Practical Approach to Design,
Implementation, and Management, 4th Edition.
Addison Wesley. Chapter 11.
Any Questions?