Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Three ways to organise data

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

45 minutes

One trip, three shapes

A school plans a trip. There are 5 students on 2 buses.

You can write this as a tree: trip, then buses, then students. You can write it as a web of links. Or you can write it as two lists that point at each other.

Each shape is a data model. Each one is good at something different.

Key words

WordWhat it meansExample
Data modelA plan for how data is organised and linked.A tree, a web or tables
Hierarchical modelData in a tree. Every item has one parent above it.Folders inside folders
Network modelData in a web of links. An item can have many parents.A map of roads
Relational modelData in tables that are linked by an id.A students table and a trips table
ParentThe item above another item in a tree.Bus A is the parent of Sam
ChildAn item below a parent.Sam is a child of Bus A
RecordOne row of facts about one thing.Sam, 16, trip 1
KeyAn id in a row that links it to a row in another table.trip_id in the students table

The cells students fill in are left blank in this preview.

Quick check: the tree

Have a go

Quick check: the tree

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Network: a web of links

In a tree, an item has one parent. In real life that is not always true.

Sam is in the chess club and in the football club. Each club has many students. So Sam has two parents: the two clubs. In a network model an item can have many parents and many children.

Relational: tables with keys

In a relational model the data lives in tables. A table has rows and columns.

We do not write the trip name next to every student. We store the trip once. Each student holds a key, the id of their trip. The tables are linked by that key.

Relational: two tables

TableColumnsExample row
tripsid, place, price1, Alton Towers, 32.50
studentsid, name, trip_id (the key)1, Sam, 1
The linkstudents.trip_id matches trips.idSam goes to Alton Towers

The cells students fill in are left blank in this preview.

The lesson goes on

8 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.