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

Preview

AESP task 4a: Share only the data that is needed

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

The delivery list with everything on it

The shop needs a list for the person who drops off orders. Somebody sends the whole customer table, with names, towns and every purchase.

The delivery person needed a first name and a town. Everything else was a risk for nothing.

Key words

WordWhat it means
Subseta part of the data, picked because it is needed
SQLa language for asking questions of data kept in tables
Querya question you ask of data, written in SQL
Viewa saved query that shows part of a table as if it were a table
Data minimisationkeeping and sharing only the data you need
Personal datafacts about a living person who can be named
Redundancythe same fact stored in more than one place
Least accessgiving each person only the access their job needs

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

By the end of this lesson

Note

I can extract a safe subset of data, avoid needless copies and say what protects data in a solution.

Starter

Have a go

Starter

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.

This is practice

Important

The real task comes from the exam board. This lesson uses an invented organisation and its own made-up data. Your teacher tells you how the real tasks are set and what you may bring.

Worked example: what each person needs

PersonNeedsShould not see
Delivery personFirst name and townSurname, purchases, points
Shop ownerEverything about her own customersNothing hidden
Report readerTotals by townAny name at all

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

Run it: a safe view

Code: sql
CREATE VIEW delivery_list AS
SELECT SUBSTR(name, 1, INSTR(name, ' ') - 1) AS first_name, town
FROM customer;

SELECT * FROM delivery_list ORDER BY first_name;

Why a view helps

A view shows only the columns you choose. Give the delivery person the view and not the table, and the surname can not leak from there.

This is least access: each person gets what the job needs. It is also data minimisation, a principle of UK data protection law.

One copy of each fact

A fact stored twice can disagree with itself. If a total is kept in a column and also worked out in a query, one will go stale.

Store each fact once. Work out totals when they are asked for, as the quarter sheet did.

The lesson goes on

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