GCSE · Computer Science · AQA · Spec 8525

Database data types

Quick bet: a telephone number is just digits, so it belongs in a number field. Right? Hold that thought. Within minutes you'll see why that bet loses.

Computer Science · Databases

Set up the club-membership table

You're building the table for a school club. Each field (a column) gets ONE data type. Pick a field, then pick the type you'd give it, and read why.

Still to sort

Integer (0)

Whole numbers only

Where the line is: No decimal part allowed. If the value can have one, it's real instead.

Real (0)

Numbers with a decimal part

Where the line is: Use it when the value can have a decimal part. Always whole? That's integer.

Boolean (0)

Only true or false

Character (0)

A single letter or symbol

Where the line is: More than one character of text? That's a string.

String (0)

Text, and digits you never calculate with

Where the line is: Made of digits is not enough to make it a number. Will you calculate with it? If not, it's a string.

6 of 6 still to sort.

Commit to a type for each field first. The reason shows up after.

Watch out: Digits are not always a number. A telephone number is made of digits, but you never calculate with it.

Predict, then check

Same club table. One member, one telephone number, one wrong choice.

A member's telephone number is 07700900123, and the telephone field has been set to integer. What does the database actually hold?

Computer Science · Databases

Where does the total go wrong?

A student wants a shop database to add two prices together to get an order total. Find the line where it goes wrong.

A student's set-up — which line goes wrong?

Computer Science · Databases

Build the data types grid

Tick every property each data type has, then check your grid against the real one.

Integer
Real
Boolean
Character
String

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Pick the right data type for every field.

What you need to know

  • A data type says what kind of value a field holds, and so what you can do with it.
  • Integer holds whole numbers only. Real holds numbers that have a decimal part.
  • Have a goA field stores each pupil's mean quiz score, which could come out as 7.5. Integer or real?

    Real.

    A mean can have a decimal part, and integer holds whole numbers only.

  • Boolean holds only true or false, which suits a yes-or-no field like 'fee paid'.
  • Character holds a single letter or symbol; a string holds text, like a surname.
  • Have a goThe Spooky Society's database has a field 'is a vampire?' that only ever holds true or false. Which data type should it be?

    Boolean.

    Boolean is the type that holds just true or false; a string is for text.

  • You pick the type from the data the field will hold and how it will be used.
  • Numbers you will calculate with suit integer or real, because calculations cannot be performed on strings.
  • Digits you never calculate with, such as a telephone number, are stored as a string so a leading zero is kept.
  • Have a goZane says his bus pass number, 0238, must be an integer because it's all digits. What do you tell him?

    Make it a string.

    Digits don't make a number type; he will never calculate with it, and a string keeps the leading zero.

  • Each field gets one data type, set once, and every record in the table follows it.
  • Before you choose, ask: what will this field hold, and will I calculate with it?

The big picture

Every field in a table has one data type (integer, real, Boolean, character or string), chosen from the data it holds and how that data will be used, not from how it looks.

Key points

1Five data types: integer, real, Boolean, character and string.
2Choose by the data a field holds and how it will be used, never by how it looks.
3Calculations need integer or real; they cannot be performed on strings.
4One data type per field, set once, for every record in the table.

Worked example

Problem

A school library keeps a table of books with five fields: Title, Number of pages, Price (for example 7.99), On loan? and Section letter (for example F). Choose a data type for each field and give a reason.

⚠ Watch out

Choosing a number type for anything made of digits. A telephone number is digits, but it is never calculated with, so it belongs in a string. Ask how the value will be used, not what it looks like.

🧠

Memory hook

Sums or no sums? If you'll calculate with it, use integer or real. If it's just digits to look at, like a telephone number, use a string.

✓

Check yourself

Name all five data types. Then pick a type for 'detentions this term' and for 'a swimmer's best time, e.g. 31.07'. What goes wrong if a field you plan to total is a string?

Flashcards

(9)
What is a data type?
It says what kind of value a field holds, and so what you can do with it.
Integer
Holds whole numbers only.
Real
Holds numbers that have a decimal part.
Boolean
Holds only true or false.
Character versus string
A character is a single letter or symbol. A string holds text.
What decides a field's data type?
The data it will hold and how it will be used, not how it looks.
Why can't you total a field set to string?
Calculations cannot be performed on strings.
Why is a telephone number stored as a string?
You never calculate with it, and a string keeps its leading zero.
How many data types does one field have?
One. It is set once for the field and every record follows it.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More AQA GCSE Computer Science topics

See the full AQA Computer Science curriculum →

How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 9 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.