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

Preview

DA 1.13: Spotting poor quality 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.

55 minutes

A customer aged 150

A club table says one member is 150 years old. Another spent 900 pounds on snacks. Sam appears twice. Two dates are written differently.

Nothing crashed. But every report from this table will be wrong. Spotting these faults is the first step to fixing them.

Key words

WordWhat it meansExample
Data qualityHow well data is fit for its use: complete, correct, consistent.No gaps or repeats
Missing dataA value that should be there but is not.An empty age
OutlierA value far from all the others.Age 150
DuplicateA row that appears more than once.Sam, twice
InconsistencyThe same fact written in different ways.Y, yes and YES
Mismatched typeA value stored as the wrong kind, such as a date as text.A price in text
UnstandardisedNot written to one agreed format.Two date styles
StructuralA problem with the file or layout, not the values.Wrong file type

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

By the end of this lesson

Note

I can name the main kinds of poor data quality and spot each one in a table.

Starter: what you already know

Have a go

Starter: what you already know

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.

Four kinds of missing data

KindWhy it is missingExample
MCARMissing completely at random: pure chanceA page of forms got wet
MARMissing at random: linked to another value we do haveYounger members skip the spend question
MNARMissing not at random: linked to the missing value itselfBig spenders hide how much they spend
SystematicA fault that always loses the same dataThe form never saved the age field

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

The other quality problems

ProblemWhat it looks like
OutlierAge 150 or spend 900
Abnormal trend or patternSales jump every night at 3am
DuplicationSam on two rows
Different formatsYear first and day first dates
InconsistencyY, yes, YES
Mismatched typeA price stored as text
StructuralA file that will not open in the tool
Unstandardisedyes/no in one file, Y/N in another

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

Try it: find the faults

Code: sql
-- Duplicates: the same name, age and spend twice.
select name, age, spend, count(*) as times
from visits
group by name, age, spend
having count(*) > 1;

-- Outliers and gaps.
select id, name, age, spend
from visits
where age is null or age > 100 or spend > 100;

A common mistake

Warning

Many people delete every row with a gap. If the gaps are not random, deleting them removes a whole group, such as every big spender. Ask why data is missing before you decide what to do.

The lesson goes on

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