Module 9: ER modelling

Turn a real-world problem into an ER diagram and then into tables: entities, relationships and cardinality.

  1. Entities, attributes and relationships: Entities become tables, composite attributes become columns, multivalued ones get their own table, derived ones are computed, and a weak entity is keyed by owner key + partial key.
  2. Cardinality and participation: 1:N puts the FK on the many side, 1:1 adds UNIQUE, M:N needs a junction table, and total participation means NOT NULL.
  3. From ER diagram to tables: Entities → tables, 1:N → FK on the many side, 1:1 → FK + UNIQUE, M:N and ternary → their own table, multivalued → its own table, total participation → NOT NULL.

Ends with a 13-question checkpoint (80% passes) and a project: Table reservations for the food app.