🧭Entity-Relationship Diagram (ERD)
Also known as ERD, ER Diagram, Entity-Relationship Model, Database Diagram
A drawing of boxes and lines. It shows the things you track and how they link.
Think of it like
It is like a family tree. Boxes are people, and lines show who belongs to whom.
Example
Before building a booking app, Emma draws an ERD. It shows that one member can make many bookings, but each booking is for one class.
Why it matters
A drawing shows mistakes that are hard to spot in tables. Fixing a line on paper is far cheaper than fixing a live database.
Definition
Example code
mermaid
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE-ITEM : containsCommon mistake
Key takeaways
- 1Boxes are things. Each box is one thing you track.
- 2Lines are links. A line shows two things are related.
- 3Ends are counts. Marks on the ends say one or many.