110 likes | 240 Views
The Entity-Relationship Model (Chapter 3 Additional Notes – Part b). Laku Chidambaram W.P. Wood Professor of MIS University of Oklahoma. Overview. Degree of a Relationship Cardinality of a Relationship Modeling Complex Relationships. Relationships. STUDENT. DORMITORY. Lives in.
E N D
The Entity-Relationship Model(Chapter 3 Additional Notes – Part b) Laku Chidambaram W.P. Wood Professor of MIS University of Oklahoma
Overview • Degree of a Relationship • Cardinality of a Relationship • Modeling Complex Relationships
Relationships STUDENT DORMITORY Lives in STUDENT COURSE Registers for
Degree of Relationship • Number of entity types involved • What degree are these relationships? • “registers for” • “is married to” • Patient “undergoes” a Test recommended by a Doctor • Common: • Unary (recursive; only one entity type is involved) • Binary (most common; two entity types are involved) • Ternary (relationship among 3 entity types)
Degree of Relationship: Examples EMPLOYEE is married to PERSON is assigned MEDICATION prescribes DOCTOR PARKING SPACE PATIENT
Cardinality • Number of instances of one entity that are associated with another. For example: • one student with many courses • one child with one father • Constraints • Minimum (lower) and maximum (upper) bounds on the number of instances • Usually 0, 1 or many • Mandatory (when min & max = 1) and optional (when min = 0)
Minimum is zero (don’t need to have any) Minimum is one (need to have at least 1) Maximum is one (can only have up to 1) Maximum is many (can have any number) Representing Cardinality
Examples of Binary Relationships (with Cardinality) Course Student takes Car Person owns Person Sport plays
Registers >| |< Student Course |< >| Student Registration Course Associative Entity (+ Cardinality)
Modeling Time-Dependent Data From McFadden, Hoffer & Prescott, 1999
Professor Course 4 Multiple Relationships is qualified to teach is scheduled to teach