From a story to a picture
A librarian tells you: "We have members and books. A member can borrow many books over time, and a book is borrowed many times."
From that story you can draw the plan of the system. This lesson gives you steps to do it, and a way to read someone else's plan.
Key words
| Word | What it means |
|---|---|
| Entity relationship diagram | a picture of the tables in a database and how they link, called an ERD |
| Entity | a thing we keep facts about, drawn as a box |
| Attribute | one fact about an entity, listed inside the box |
| Primary key | the field that gives every record its own unique id; underline it |
| Foreign key | a field that points at a record in another table; put a star after it |
| Cardinality | how many records link on each side: one or many |
| Link table | an extra table that turns a many-to-many link into two one-to-many links |
| Database | an organised store of tables that you can ask questions |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can read an ERD, and draw or complete one from a description, with keys marked and cardinality shown.
Starter
Have a go
Starter
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
Read the diagram
Have a go
Read the diagram
5 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.