Plan the house before the bricks
Nobody builds a house by laying bricks and hoping. First comes a sketch of the rooms. Then a plan with sizes. Last comes the real building.
A data system is built the same way. Today we plan a made-up bike hire scheme in three steps.
Key words
| Word | What it means | Example |
|---|---|---|
| Data model | A plan that shows what data a system holds and how the parts connect. | A diagram of customers, bikes and hires |
| Entity | A thing the business keeps data about. | Customer, Bike, Hire |
| Attribute | One fact about an entity. | A customer name |
| Relationship | How two entities connect. | A customer makes many hires |
| Conceptual model | The big picture: entities and relationships, no technical detail. | Boxes and lines |
| Logical model | The same picture with attributes, keys and data types. | Customer has an id and a name |
| Physical model | The model built for a real tool, with exact types and rules. | A create table statement |
| Primary key | A column whose value is different in every row. | customer_id |
| Foreign key | A column that holds the primary key of a row in another table. | customer_id inside hire |
| Database | A store of organised data, kept in tables. | The hire tables |
| Data type | The kind of value a column holds, such as whole number, text or date. | Integer, text, date |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can tell the three kinds of data model apart, say what each shows, and read a simple entity relationship diagram.
Starter: what you already know
Have a go
Starter: what you already know
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
Why model first
A data model gives people a shared picture before any system exists. The customer, the analyst and the builder can all point at it and say "that is wrong".
Changing a drawing costs minutes. Changing a built system costs weeks. So we move from the broad picture to the detail in three levels.
Worked example: three levels compared
| Level | What it shows | Who it is for | Bike hire example |
|---|---|---|---|
| Conceptual | Entities and how they relate. Attributes at most named in words | Business people | Customer, Bike and Hire, joined by lines |
| Logical | Attributes, keys and data types, but no tool chosen | Analysts and designers | Hire has a hire_id key and two foreign keys |
| Physical | The model built for one tool, with exact types and rules | Builders | A create table statement for a database |
The cells students fill in are left blank in this preview.
Check: read the big picture
Have a go
Check: read the big picture
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.