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.11: Big data and why types must agree

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

50 minutes

The sum that came out as zero

A shop adds up its prices. The answer says zero. Nothing is wrong with the till. One price was typed as "£3.00" with a pound sign, so the column became text.

Text cannot be added. This lesson shows why types must agree before you calculate or join data.

Key words

WordWhat it meansExample
Big dataData so large, fast or varied that ordinary tools struggle with it.Every till sale in a country
VolumeHow much data there is.Ten million rows
VelocityHow fast new data arrives.A sensor reading every second
VarietyHow many different forms the data takes.Tables, photos and posts
VeracityHow true and trustworthy the data is.Is the sensor accurate?
ValueHow useful the data is for the decision.Does it help the shop plan?
SensorA device that measures something, such as heat or movement.A fridge sensor
BlendingJoining data from different sources into one table.Sales joined to weather
StandardisedWritten the same way everywhere.All dates as year-month-day

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

By the end of this lesson

Note

I can name the five Vs of big data and explain why standard, compatible types matter.

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.

The five Vs

VIt asksExample
VolumeHow much?Millions of till rows
VelocityHow fast?A reading each second
VarietyHow many forms?Tables, photos, posts
VeracityHow true?A faulty sensor gives false data
ValueHow useful?Does it change a decision?

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

Why the types must agree

Standardised data uses the same type for the same kind of value everywhere. All prices are numbers. All dates follow one format.

Appropriate data uses the right type for the job and fits the data beside it. You can add numbers. You cannot add text. Two tables can only be blended when their matching columns have compatible types.

Try it: text sorts differently

Code: sql
select n from text_numbers order by n;

-- Now the same numbers, stored as integers.
select n from real_numbers order by n;

-- Try it: add desc after order by n and press Run.

Try it: add the prices

Code: sql
-- The pound sign makes one price text.
select item, price, cast(price as real) as as_number
from prices;

-- Try it: wrap sum() around the cast column.

The lesson goes on

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