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

Preview

DA 2.10: Importing and exporting data safely

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 export that went wrong

A club leader exports a list to send to the trip company. The file has repeated rows, a column of home phone numbers nobody asked for, and a comma that split one name in two.

Moving data is simple. Moving it well takes care.

Key words

WordWhat it means
Importread data from a file into a system
Exportsave data out of a system as a file
Redundant datadata that is repeated or not needed
Delimiterthe mark that splits values in a file, such as a comma
Data minimisationsharing only the data that is needed
Personal datadata about a living person who can be identified

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

By the end of this lesson

Note

I can import and export data in a standard form and keep it within the law.

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.

Review, then standardise for the move

First review the data. What does it hold? Who owns it? What must the receiver get?

Then standardise it. Fix quality problems. Use the format the receiver expects. Remove redundant data: repeated rows and columns nobody needs.

Try it: remove the redundant data

Code: duckdb
select distinct pupil_id, name, form, note
from pupil_export
order by pupil_id;

-- Repeated Ada is gone. The phone column was left out on purpose.

Check

Have a go

Check

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

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.