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

Preview

Drawing data models

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

Draw it before you build it

A builder draws a plan before the first brick. A programmer draws the data before the first line of code.

A good drawing lets a team agree in five minutes. Without it, they talk for an hour and still disagree.

Today you draw all three data models.

Key words

WordWhat it meansExample
BlockA box in a drawing. It shows one item.A box with Coach A in it
ArrowA line with a point. It joins one block to another.Coach A to Sam
LabelWords on a block or arrow that say what it is.5 min
ParentThe block that an arrow comes from. It is above its child.Head teacher
ChildThe block that an arrow points to.Head of Science
Hierarchical modelA tree. Every item has one parent.Folders
Network modelA web. An item can have many parents.Bus routes
Relational modelTables linked by keys.Clubs and members
KeyA column that links a row to a row in another table.club_id
RowOne record in a table.1, Sam, 1
ColumnOne kind of fact in a table.name

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

Quick check: read the drawing

Have a go

Quick check: read the drawing

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.

Rules for trees and webs

Draw one block for each item. Draw an arrow for each link. Put a label on a block to name it. Put a label on an arrow to say what the link means.

In a tree, arrows go from parent to child, and each block gets one arrow in. In a network, a block can get many arrows in. In the bus map below, a bus goes from the start of an arrow to its point. School gets two arrows in.

Rules for tables

A relational model is drawn as tables. Write the name of the table on top. Put the columns across the top row. Put each record in one row below.

Mark the key column. It links a row to a row in the other table. Look at the two tables below. In the members table, club_id 1 points to Chess.

The lesson goes on

9 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.