Professional Documents
Culture Documents
ENTITY-RELATIONSHIP CSI300
MODEL AUCE
1
CHAPTER OBJECTIVES
Learn the basic stages of database development
Understand the purpose and role of a data model
Know the principal components of the E-R data model
Understand how to interpret traditional E-R diagrams
Understand how to interpret Information Engineering (IE) Crow’s Foot E-R
diagrams
Learn to construct E-R diagrams
Know how to represent 1:1, 1:N, N:M, and binary relationships with the E-R model
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
ER-DIAGRAM
NOTATION FOR ER SCHEMAS
Symbol
30
ER-DIAGRAM
NOTATION FOR ER SCHEMAS
Symbol
31
REFINING THE COMPANY INITIAL DESIGN BY
INCLUDING RELATIONSHIPS
• In the refined design, some attributes from the initial entity types are
refined into relationships:
– Manager of DEPARTMENT MANAGES
– Works_on of EMPLOYEE WORKS_ON
– Department of EMPLOYEE WORKS_FOR
– etc
• In general, more than one relationship type can exist between the
same participating entity types
– MANAGES and WORKS_FOR are distinct relationship types between
EMPLOYEE and DEPARTMENT
– Different meanings and different relationship instances.
35
RECURSIVE RELATIONSHIP
TYPE
• A relationship type with the same entity type participating twice in
two distinct roles
• Example: the SUPERVISION relationship
• EMPLOYEE participates twice in two distinct roles:
– supervisor (or boss) role
– supervisee (or subordinate) role
– must distinguish the roles in a relationship instance
• Each relationship instance ri relates two distinct EMPLOYEE
entities (see next slide):
– One employee in supervisor role (labeled 1)
– One employee in supervisee role (labeled 2)
36
Recursive Relationship Type
ATTRIBUTES OF RELATIONSHIP
TYPES
• A relationship type can have attributes:
– For example, HoursPerWeek of WORKS_ON
– Its value for each relationship instance describes the
number of hours per week that an EMPLOYEE works
on a PROJECT.
• A value of HoursPerWeek depends on a particular (employee,
project) combination
38
A TERNARY RELATIONSHIP
EXAMPLE
since
name dname
ssn lot did budget
Locations
Departments
address capacity Employees Works_Ins
40
ER DIAGRAM FOR A BANK
DATABASE
© The Benjamin/Cummings Publishing Company, Inc. 1994, Elmasri/Navathe, Fundamentals of Database Systems, Second Edition
41
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58