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: The data types an analyst meets

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

Is 10 bigger than 9?

Sort the numbers 9, 10 and 100 as numbers, and you get 9, 10, 100. Sort them as text, and you get 10, 100, 9.

The same marks give two answers. What decides is the type of data. Every column needs the right type, or a calculation can go wrong.

Key words

WordWhat it meansExample
Data typeThe kind of value a field holds, which decides what you can do with it.Whole number or text
IntegerA whole number with no decimal part.14
FloatA number with a decimal point, stored in a small space.2.5
DoubleA decimal number stored with more digits of accuracy than a float.3.14159265
BooleanA value that is only true or false.Paid: true
TemporalAbout time: a date, a time or a duration.2026-03-02
GeospatialAbout a place on the Earth, such as a map position.A latitude and longitude
PointerA value that tells you where other data is stored.A customer id in an order row

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

By the end of this lesson

Note

I can name the main data types, say what each holds, and pick the right one for a field.

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.

Numbers, money and time

GroupTypesExample
NumericInteger14 pupils
NumericDecimal: float or double2.5 kilometres
FinancialCurrency12.50 pounds
TemporalDate2026-03-02
TemporalTime10:15
TemporalDuration45 minutes

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

Words, places, media and more

GroupTypesExample
TextSingle or many characters, words, paragraphsY, Sam, a long review
GeospatialLocationLatitude and longitude of a shop
MediaImage, audio, videoA product photo
LogicalBooleanIs it paid: true or false
ReferencePointer to other dataA customer id that points to a customer row

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

Try it: ask DuckDB for each type

Code: duckdb
select typeof(14) as whole,
  typeof(2.5::float) as small_decimal,
  typeof(2.5::double) as big_decimal,
  typeof(12.50::decimal(8,2)) as money,
  typeof(date '2026-03-02') as a_date,
  typeof(time '10:15:00') as a_time,
  typeof(interval 45 minute) as a_duration,
  typeof(true) as yes_no;

-- Try it: add typeof('Sam') to the list.

A common mistake

Warning

Many people store a phone number or a postcode as a number. Nobody adds phone numbers. A leading zero would vanish. If you never calculate with it, store it as text.

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.