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
| Word | What it means | Example |
|---|---|---|
| Big data | Data so large, fast or varied that ordinary tools struggle with it. | Every till sale in a country |
| Volume | How much data there is. | Ten million rows |
| Velocity | How fast new data arrives. | A sensor reading every second |
| Variety | How many different forms the data takes. | Tables, photos and posts |
| Veracity | How true and trustworthy the data is. | Is the sensor accurate? |
| Value | How useful the data is for the decision. | Does it help the shop plan? |
| Sensor | A device that measures something, such as heat or movement. | A fridge sensor |
| Blending | Joining data from different sources into one table. | Sales joined to weather |
| Standardised | Written 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 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
The five Vs
| V | It asks | Example |
|---|---|---|
| Volume | How much? | Millions of till rows |
| Velocity | How fast? | A reading each second |
| Variety | How many forms? | Tables, photos, posts |
| Veracity | How true? | A faulty sensor gives false data |
| Value | How 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
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
-- 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.