Caffeinated Coder
Book an appointment
Lesson 09 · Design

Entity-relationship modelling

Before you write CREATE TABLE, draw the world you want to store. An entity-relationship (ER) model names the things (entities), the facts about them (attributes, one of them a key) and how they connect (relationships, each one-to-many or many-to-many). Then fixed rules turn the diagram into tables: follow a small library from a one-line brief to four PostgreSQL tables that refuse bad data and answer who borrowed what.

14 min10 steps5 questionsIntermediate
Fig 9 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.