Where does the notebook live?
A shop group tracks products, shops and the customers who buy them. One product is stocked in one shop. But one customer may buy in three shops, and one shop has many customers.
How you link these things changes how fast you can answer a question. There are three common ways to organise the links.
Key words
| Word | What it means | Example |
|---|---|---|
| Data model | A way of organising data and the links between items. | Relational |
| Hierarchical model | Items in a tree, each with one parent. | Folders |
| Network model | Items linked in any direction, so an item can have several parents. | Customers linked to many shops |
| Relational model | Data in tables, linked by shared key values. | Products and shops tables |
| Key | A value that identifies a row. | S1 |
| Efficiency | How little time and space a job uses. | A fast lookup |
| Complexity | How hard something is to build and understand. | Many linked tables |
| Query | A question asked of stored data. | Which shop sells most notebooks? |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can describe three ways of organising linked data and say when each is best for analysis.
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.
Three data models
A data model says how data and its links are organised.
The hierarchical model is a tree. Each item has one parent. Folders work this way.
The network model allows any item to link to any other, so an item can have several parents.
The relational model keeps data in tables. A key in one table points to a row in another.
Worked example: products and shops
| Model | How it holds the same data | Easy question | Hard question |
|---|---|---|---|
| Hierarchical | Shop, then the products under it | What is in the North shop? | Where is every notebook? |
| Network | Products, shops and customers linked both ways | Who buys in two shops? | A new question with no ready link |
| Relational | A products table and a shops table joined by shop id | Almost any question | Nothing is very hard, but it is more work to set up |
The cells students fill in are left blank in this preview.
Check: which model?
Have a go
Check: which model?
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.