Week 7 - Entity-Relationship Modelling Flashcards
What is a weak entity?
An entity that depends on another entity (owner entity) for its identity.
How is the primary key of a weak entity formed?
It combines the primary key of the owner entity with some additional attributes.
Give an example of a weak entity relationship.
A “Copy” entity dependent on a “Book” entity, or a “Borrower” entity dependent on a “Member” entity.
What attributes form the primary key for the weak entity “Copy”?
book id (primary key of the owner entity “Book”) and copy num.
Identify the primary key attributes for the weak entity “Borrower”.
member num (primary key from “Member”) and first name.
Why is the “Borrow” table complex?
It links multiple entities and includes composite keys (book id, copy num, member num, first name) along with borrowing details like dates and fines.
Provide an example schema for a weak entity.
- Copy(book id, copy num)
- Borrower (member num, first name)
Both rely on keys from their main (owner) entities.
What do hierarchies represent in ER-models?
They represent “is-a” relationships, similar to inheritance in object-oriented programming.
Give an example of an entity hierarchy in a university setting.
UG_student (undergraduate) and PGT_student (postgraduate taught) entities are specialisations of a general student super-entity.
Provide an example of a vehicle hierarchy in ER-modelling.
Cars, trucks, and motorcycles are special cases (sub-entities) of a general vehicle super-entity.
Illustrate a customer hierarchy with an example.
Private customers and business customers are specialised entities derived from a more general customer entity.
What does “coverage” mean in ER hierarchies?
Whether subclasses fully (totally) or partially cover all instances of the superclass.
Explain “overlap” in ER hierarchies.
Indicates if subclasses can share common instances (overlapping) or must be mutually exclusive.
Provide an example illustrating partial coverage and mutual exclusivity in entity hierarchies.
“Private customer” and “Commercial customer” entities partially cover the “Customer” superclass, as there can be other types (e.g., government, charities).
They are mutually exclusive since no instance can be both types simultaneously.