GCSE · Computer Science · AQA · Spec 8525

Database data types

Quick bet: a telephone number is all digits, so it goes in a number field. Right? Hold that thought. In a few minutes you'll watch that bet lose a zero.

Computer Science · Databases

Set up the club-membership table

You're setting up the table for a school club. Each field (a column) gets ONE data type, and every member's record will follow it. Pick a field, pick the type you'd give it, then 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, which can include digits and symbols

Where the line is: Being made of digits isn't enough to make it a number. Will you calculate with it? If not, digits go in a string.

6 of 6 still to sort.

Commit to a type for each field first. The reason only 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. It doesn't work. Find the line where it goes wrong.

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

Computer Science · Databases

Build the data types grid

Your turn to build the cheat sheet. 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, also called floating point, holds numbers with 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 come out with a decimal part, and integer holds whole numbers only, so it needs real.

  • Boolean holds one of two values, true or false, so it suits a yes-or-no field like 'fee paid'.
  • Character holds a single letter or symbol; a string holds text, which can include digits and symbols too.
  • 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 would hold text, which is more than this field needs.

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

    Make it a string.

    Being all digits doesn't make it a number type: he'll never calculate with it, and an integer would drop that leading 0.

  • Each field gets one data type, set once when the table is set up, and every record follows it.
  • Stuck? Ask two things: what will this field hold, and will I ever 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.
4Digits you never calculate with, like a telephone number, go in a string so a leading zero survives.
5One 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 nobody calculates with it, so it belongs in a string, where its leading zero is safe. 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 read, 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, like 3.
Real
Holds numbers that have a decimal part, like 5.3. Also called floating point.
Boolean
Holds one of two values: true or false.
Character versus string
A character is a single letter or symbol, like a. A string is text, and can also contain digits and symbols.
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 as an integer it would lose its leading zero. A string keeps it.
How many data types does one field have?
One. It is set once for the field, when the table is set up, 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 30 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.