Professional Documents
Culture Documents
Diagram
Lecturer:
Hesham Gamal Gaafar
HGGaafar1@gmail.com
Room:3004
Made by:
Shahinaz S. Azab
Entity Relationship Modeling
2
Definitions
3
Entities
• Strong Entity
• Weak Entity Entity
Weak Entity
4
Weak Entity Types
5
Types of Attributes
6
Key Attribute
7
Simple Attributes
ID Name
Employee
8
Composite Attributes
Month
Day
Birth
Date
Year
Employee
9
Derived Attributes
Birth
Date
Employee Age
10
Multi-Valued Attributes
Employee
Phone
11
Complex Attributes
Value
Type
Contact
Employee
12
Relationships
13
Degree Of Relationships
• Number of entity types that participate in a relationship
• Three cases
• Unary: between two instances of one entity type
• Binary: between the instances of two entity types
• Ternary: among the instances of three entity types
14
Unary Relation (Recursive)
Married
Person to
Manag
Employee es
15
Binary Relation
16
Ternary Relation
Date
Drug
17
Cardinality
• How many instances of one entity will or must be connected to a single
instance from the other entities.
• One-One Relationship
• One-Many Relationship
• Many- Many Relationship
18
One-One Relationship
1 1
Person Has Passport
19
One-Many Relationship
1 M
Person Has Car
20
Many-ManyRelationship
M M
Student Study Course
21
Participation Constraint
22
Participation Example
23
Relationships (Summary)
1. Degree of a Relationship
a. Unary/ Recursive
Emp lead
b. Binary
c. Ternary
Supplier supply Part
Project
24
Relationships (Summary)
2. Cardinality Ratio
a. One to one
1 1
Emp manage Dept
b. One to many
M 1
Emp work Dept
c. Many to many
M N
Emp work Proj
25
Relationships (Summary)
3. Participation
1 1
Emp manage Dept
Partial Total
26
SUMMARY OF ERD NOTATION
Symbol Meaning
ENTITY TYPE
RELATIONSHIP TYPE
ATTRIBUTE
KEY ATTRIBUTE
MULTIVALUED ATTRIBUTE
COMPOSITE ATTRIBUTE
DERIVED ATTRIBUTE
E1 R E2 TOTAL PARTICIPATION OF E2 IN R
27
An Example
28
An Example (Cont’d)
29
30
Questions ?
31
ERD Case Study
32
ERD Case Study
33
ERD Case Study 2
34
ERD Case Study 2
35
ERD Narrative: Lab
36
ERD Narrative ( Cont’d)
37