24 min read
ER Diagrams
Read crow's-foot notation. Lines join fields that must match. They are not data-flow arrows.
What Is an ER Diagram?
Oliver Bennett asks for a picture he can pin above the desk. Not another spreadsheet — a map of how the tables connect.
Amelia Hart draws three boxes: Members, Loans, Books. She draws lines from MemberID to MemberID, and from BookID to BookID. At the Loans end of each line she adds a crow's-foot mark — the “many” side.
Oliver squints. “So data flows from Members into Loans?”
“No,” Amelia says. “The line means those two fields must match. Nothing slides along it.”
An entity-relationship diagram — ER diagram for short — is a picture of the entities in a database and how they connect.
- Each box is an entity (a table).
- Each line joins the fields that must match.
- A crow's-foot mark means “many” on that side. A single mark means “one”.
Read MEMBERS ||--o{ LOANS as: one member, many loans, connected on MemberID.
Crow's-Foot Notation
On the interactive diagram below, the single mark sits on Members: one member. The crow's foot sits on Loans: many loans.
The lines anchor on the fields: MemberID to MemberID, BookID to BookID. You do not draw from FullName to Title.
Click a key. The matching fields light up. You are looking at identity, not at data moving across the screen.
Members and Books connect to Loans on matching keys
The bar marks the ONE side (the primary key). The three lines mark the MANY side (the foreign key). The line joins those two fields — it is not a flow of data.
Click a key icon, a field name, or a relationship line to highlight the matching fields.
The same library as an ER diagram
If you read the line as “members send data to loans”, stop. Read it as “this field must match that field”. The crow's foot counts rows. It does not move values.
The same idea applies to Lockers: MEMBERS ||--o| LOCKERS on MemberID means one member, at most one locker.
Practice
Swipe or use the arrows to move between questions.
1 / 3
Section check
Before you continue: keys and relationships
Primary keys, foreign keys, cardinality, and ER diagrams — try tracing MemberID and BookID through the library.
This is practice, not the final assessment. Use hints. Look up a lesson if you are unsure — there is no score.
Self-check
Self-check
Self-check
Self-check
Connect Members.MemberID to Loans.MemberID.
Drag from a key on the right of one table onto a key on the left of another. Delete a line with Backspace.
More lessons in Database Fundamentals · Next: One-to-Many · Previous: How Keys Connect Tables
