Database DesignRelationships & ER diagramsLesson 21 / 69

Draw an ER diagram

Exercise35 min

Draw an ER diagram

An entity-relationship diagram is the picture of your schema: boxes for entities, lines for relationships, 1 and N at the ends, underlined keys.

The discipline that makes diagrams useful is the same one that makes code useful: name things precisely. orders.user_id says more than "a link".

In this roadmap you will design and grade diagrams in the diagram lab — a real ER editor backed by the same database concepts. Design once on paper, then rebuild it live in the lab.

Exercise

Draw the library schema: members, books, authors, loans. Mark every 1/N end and both primary keys. Then open the diagram lab and rebuild it.

Practice in the diagram lab

This lesson's practice belongs in the diagram editor — design the schema you just read about, grade it against the solution, and save it to your account.

Open the diagram lab