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

Preview

Normalisation to third normal form

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

55 minutes

Ms Khan changes her name

A school shop keeps one big table. Every order row has the customer's form tutor, Ms Khan, typed in again and again. There are 300 rows with her name.

Then Ms Khan changes her surname. Somebody changes 299 rows. One row is missed. Now the data says two different things.

Normalisation means organising tables so each fact is stored once. It fixes this problem.

Key words

WordWhat it meansExample
FormA class group in a UK school. A tutor is the teacher who looks after one form.12B
NormalisationOrganising tables so each fact is stored once.
DatabaseAn organised store of data that programs can search and change.
Primary keyA field that is different in every row. It finds one row.
Foreign keyA field that holds the primary key of a row in another table.
RedundancyThe same fact stored more than once.
Repeating groupSeveral values put in one cell.Hoodie, Cap
First normal form (1NF)One value in every cell and no repeating groups.
Second normal form (2NF)In 1NF, and every field depends on the whole key.
Third normal form (3NF)In 2NF, and no field depends on another field that is not the key.

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

The trouble with one big table

When the same fact is stored many times, three bad things happen.

You waste space. You must change many rows for one change, and you can miss one. And you cannot store a fact on its own. You cannot add a new form tutor until a student orders something.

Normalisation fixes this in three steps.

Quick check: the problem

Have a go

Quick check: the problem

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.

Start: the unnormalised table

OrderCustomerFormTutorItems
1Aisha12BMs KhanHoodie 25 pounds (quantity 1), Cap 8 pounds (quantity 2)
2Ben10AMr LeeCap 8 pounds (quantity 1)
3Sam12BMs KhanHoodie 25 pounds (quantity 1)

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

Step 1: first normal form

Look at the Items column. Order 1 has two items in one cell. This is a repeating group.

To reach 1NF, give each item its own row. Each cell holds one value. The key is now two fields together: Order and Item.

Result: 1NF

OrderItemPriceQuantityCustomerFormTutor
1Hoodie251Aisha12BMs Khan
1Cap82Aisha12BMs Khan
2Cap81Ben10AMr Lee
3Hoodie251Sam12BMs Khan

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

Quick check: first normal form

Have a go

Quick check: first normal form

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.

The lesson goes on

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