Entity-Relationship Model
Modeling
Entity Sets instructor and student
instructor_ID instructor_name student-ID student_name
Relationship Sets
Example:� 44553 (Peltier) advisor 22222 (Einstein) � student entity relationship set instructor entity
{(e1, e2, … en) | e1 ∈ E1, e2 ∈ E2, …, en ∈ En}��where (e1, e2, …, en) is a relationship
(44553,22222) ∈ advisor
Relationship Set advisor
Relationship Sets
Degree of a Relationship Set
Attributes
instructor = (ID, name, street, city, salary )� course= (course_id, title, credits)
Composite Attributes
Mapping Cardinality Constraints
Mapping Cardinalities
One to one
One to many
Note: Some elements in A and B may not be mapped to any
elements in the other set
Mapping Cardinalities
Many to one
Many to many
Note: Some elements in A and B may not be mapped to any
elements in the other set
Keys
Keys for Relationship Sets
Redundant Attributes
and a relationship
E-R Diagrams
Entity With Composite, Multivalued, and Derived Attributes
Relationship Sets with Attributes
Cardinality Constraints
One-to-One Relationship
One-to-Many Relationship
Many-to-One Relationships
Many-to-Many Relationship
Participation of an Entity Set in a Relationship Set
E-R Diagram with a Ternary Relationship
Weak Entity Sets
Weak Entity Sets
Weak Entity Sets
E-R Diagram for a University Enterprise
Reduction to Relational Schemas
Reduction to Relation Schemas
Representing Entity Sets With Simple Attributes
Representing Relationship Sets
advisor = (s_id, i_id)
Redundancy of Schemas
Redundancy of Schemas
Composite and Multivalued Attributes
Composite and Multivalued Attributes
Multivalued Attributes
Design Issues
Design Issues
Design Issues
e.g., attribute date as attribute of advisor or as attribute of student