Database Systems I: Database Design, ER Modelling
Database Systems I: Database Design, ER Modelling
Introduction to ER Modelling
Defining the entities and attributes, and the relationships between these
--> The ER model
3.Logical Database Design (Map ER to Relational Schema)
4.Schema Refinement (fine tune )
5.Physical Database Design
Implementation of the design using a Database Management System
6.Security Design
Implement Controls to ensure security and integrity
Eg. ER Model
◦ We utilize the conceptual schema created in the previous step and convert it
into a schema of a particular data model* (e.g. Relational Data Model )
ENTITY
WEAK ENTITY
RELATIONSHIP
IDENTIFYING RELATIONSHIP
ATTRIBUTE
KEY ATTRIBUTE
MULTIVALUED ATTRIBUTE
COMPOSITE ATTRIBUTE
DERIVED ATTRIBUTE
E1 R E2
TOTAL PARTICIPATION OF E2 IN R
1 N
E1 R E2
CARDINALITY RATIO 1:N FOR E1:E2 IN R
(min,max)
R E
STRUCTURAL CONSTRAINT (min, max) ON PARTICIPATION OF E IN
R
Student
•Graphically, ENTITY
age
salary
salary name
e1
age id
e2 age
e3
Employee
e4
e5 i
e6 d
…
name
Graphically, Employee
name
surname middle_name
first_name
Student
E-mail
first_name
surname
gmail , yahoo
Employee
age
name
Derived attribute
stuNum
stuName
stuMajor
stuDob
stuHrs
stuYr
stuGpa
stuAge
salary name
e1
age id
e2
e3
e4
Employee Entity set e5
e6
…
Name
Employee
Candidate
eid nic
key
Example :
Composite key = (First name + surname + tel)
Key = NIC
Student gender
studentID dob
courseNo
Course coursename
fee
duration faculty
N 1
Student registers Course
relationship
startdate
since
N 1
Employee Works in Department
e011 1/2/09
HR
e022
1/5/01
Sales
e033 1/2/07
Marketing
e044
1/3/05
Departments
Employees
Work_in
Ex : Arpico super centers are situated all over the country and each Arpico super center mainly
contains 5 departments such as furniture , rubber, plastic, supermarket items and maintenance.
Location
• one-to-one (1: 1)
• one-to-many (1 : N)
• many-to-many. (N : M)
1 1
Employee Manages Department
N 1
Employee Works in Department
M N
Employee Works on Project
Participation Constraint
Student?
It inherits at least part of their primary key from the entity to which it is related.
Entity types without any key attributes is called weak entity types. Double
lined box
1 M
Employee covers Dependent
Partial key
• The weak entity must have total participation in the identifying relationship.
Strong entity
1 M
Employee Policy Dependent
Partial key
leads
Student
name
position
staffNo
Staff
Specialization/generalization indicator
Hours worked
Contract_ duration
Hourly rate