Lecture 10 - Entity-Relationship Models#
Announcements#
Lecture Exercise 10 is out later today, due on thursday at 2pm.
Course database server will be available soon! Wait for your username/password in email.
Today’s topics#
Entity-Relationship Modeling
Ternary relationships
Weak entities
Hierarchies
Relations:
R1(A,B,C)
R2(A,D)
R3(A,E)
Or
R1(A,B,C,D,E)
Weak Entities#
Weak entity (represented with double rectangle) has a key, but its key is not guaranteed to be unique in the database
Each weak entity has one or more entities is depends on (represented with a relationship with double diamond)
The key of the weak entity combined wuth the key of the entity it depends on together is unique!
When mapping a weak entity to the relational data model, we map the weak entity and dependance relationship together:
The key of the resulting relation is the combination of the key of the weak entity and the keys of the entities it depends on together.
Anytime the weak entity participates in a relationship, then its key should be the key obtained in the above mapping.
Entity Hierarchies:#
Are entities disjoint? Are sub-entities together make up all the super entity (covering)