Professional Documents
Culture Documents
02 Chapter 02 ER Diagram
02 Chapter 02 ER Diagram
02 Chapter 02 ER Diagram
e1
e2
e3
e4 EMPLOYEES
e5
e6
…
Attribute
name
Employee Entity set
MIT 12063, Database Design and Development By: S.Sabraz Nawaz 6
E-R Model (Attributes…)
name
EMPLOYEES
LastName FirstName
EMPLOYEES
EMPLOYEES
dob age
name
Customers
salary name
e1
dob e2 id
e3
e4
e5
e6 Employee Entity set
…
id
• Therefore,
A key is a minimal set of attributes whose values uniquely
identify an entity in the set.
Graphically,
nic dob
18
MIT 12063, Database Design and Development By: S.Sabraz Nawaz
E-R Model (Relationship…)
1/2/97
111 1/2/99
D1
222
1/5/01
D2
333
1/2/87
D3
444
1/3/95
Departments
Employees
Work_in
MIT 12063, Database Design and Development By: S.Sabraz Nawaz 19
E-R Model (Relationship…)
1/1/91
111 3/3/93
D1
222 2/2/92
D2
333 3/1/92
D3
444
3/1/92
Departments
Employees
Work_in
MIT 12063, Database Design and
20
Development By: S.Sabraz Nawaz
E-R Model (contd.)
Ternary relationship
D1
111
D2 Departments
222
333 D3
444
Employees
L1
Work_in L2
Locations
L3
MIT 12063, Database Design and
22
Development By: S.Sabraz Nawaz
E-R Model (contd.)
Ternary relationship
works DEPARTMENTS
EMPLOYEES
in
LOCATIONS
One-to-One relationship
One-to-Many relationship
For example, an employee works in at most one department.
Graphically,
EMPLOYEES works
DEPARTMENTS
in
Many-to-Many relationship
works
EMPLOYEES PROJECTS
on
• Entity types without any key attributes is called weak entity types.
• A weak entity is uniquely identified by considering some of its
attributes with the primary key of another entity called the
identifying owner.
• The attributes in the weak entity participating in the key are called
partial keys
• The owner entity and the weak entity participates in an identifying
relationship.
• The cardinality of the identifying relationship is either one-to-one
or one-to-many from owner entity to weak entity
• The weak entity must have total participation in the identifying
relationship
MIT 12063, Database Design and
29
Development By: S.Sabraz Nawaz
E-R Model (contd.)
1 M
EMPLOYEE Policy DEPENDENTS
id name age
manages
supervisor subordinate
EMPLOYEES
MIT 12063, Database Design and
31
Development By: S.Sabraz Nawaz
Reference:
Ramakrishnan, R., & Gehrke, J. (2003). Database management
systems. Osborne/McGraw-Hill. (p. 24-50)