Why "10" comes before "9"
An analyst sorts a product list by item number. The list goes 1, 10, 100, 2, 3.
The computer is treating the numbers as words. In a word list, "10" comes before "2" because "1" comes before "2". The fix is to store the number as a number. This lesson is about choosing the right type.
Key words
| Word | What it means | Example |
|---|---|---|
| Data type | The kind of value a field holds. | Integer |
| Integer | A whole number. | 42 |
| Real | A number with a decimal point. | 21.5 |
| Character | One letter, digit or symbol. | Y |
| String | Text made of characters. | NOTEBOOK-07 |
| Boolean | True or false. | True |
| Date | A day, month and year. | 2026-10-28 |
| Blob | A large binary object such as a picture or a file, stored whole. | A product photo |
The cells students fill in are left blank in this preview.
By the end of this lesson
Note
I can choose the right type for a piece of data and explain why.
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.
Numbers and truth values
An integer is a whole number: items in a basket, tickets sold. A real number has a decimal point: a price, a temperature, a download speed.
A Boolean holds only true or false. Use it for a yes or no, such as "is it in stock?".
Characters and strings
A character is a single letter, digit or symbol. A grade of "A" or a yes flag of "Y" is a character.
A string is text made of characters: a username, a product name, a stock code. A phone number is a string, because you never add phone numbers.
Dates and blobs
A date stores a day, month and year. It lets the computer sort by time and work out gaps, such as how many days an order has waited.
A Blob stores a large object, such as a photo, a PDF or a recording, as one whole item. You save and open a blob. You do not add it up.
Types in a product list
| Field | Example | Type | Why |
|---|---|---|---|
| Pack size | 24 | Integer | A whole count |
| Price | 3.99 | Real | Has pence |
| Quality grade | B | Character | One letter |
| Stock code | NOTEBOOK-07 | String | Letters, digits and a dash |
| In stock | True | Boolean | Yes or no |
| Added on | 2026-09-03 | Date | Lets us sort and count days |
| Photo | notebook07.jpg | Blob | A whole picture file |
The cells students fill in are left blank in this preview.