The big idea: A column's data type says what kind of value may be stored in it.
It is not a suggestion: the database refuses anything that does not fit, which is the first line of defence against bad data.
It decides more than storage: The type also decides what you can do with the values.
You can add numbers and sort dates in real order. Do the same to text and you get nonsense — "10" sorts before "9".
Free preview
This is the free notes preview
You're reading the free notes. Aimnova Pro unlocks the full study experience — and you can try it with your first topic free to keep:
- FlashcardsLock in vocabulary and key terms with spaced repetition.
- Practice questionsAnswer exam-style questions and get instant AI marking.
- Mock exams & past-paper vaultSit full mocks and see exactly how examiners award marks.
- Personalised study planA daily plan built around your exam date and weak areas.
Numbers
- Integer — whole numbers: a quantity, an ID, a year
- Decimal — exact fractions: money, measurements
- Float — approximate fractions, for scientific values
- Never use float for money; small rounding errors accumulate
Text
- Char — fixed length, padded: a two-letter country code
- Varchar — variable length up to a limit: a name, an address
- Text — long free text, with no practical limit
- Varchar is the usual choice for anything human-written
Everything else
- Date and DateTime — real dates, sortable and subtractable
- Boolean — true or false, for a yes-or-no fact
- Currency where the system offers it, for exact money
- Each exists because the alternative is storing it as text
The test for choosing: Ask: will I ever calculate with it, compare it, or sort it?
If yes, it needs a real type. If it is only ever displayed — a phone number, a postcode — text is correct, even though it looks like a number.
Feeling unprepared for exams?
Get a clear study plan, practice with real questions, and know exactly where you stand before exam day. No more guessing.
A date stored as text
Sorting puts 01/12/2026 before 02/01/2025, because it compares character by character.
You also cannot ask for "everything in the last 30 days", and nothing stops someone typing 31/02/2026.
A number stored as text
"10" sorts before "9", and totals cannot be calculated without converting every value first.
Nothing stops a typo like "12O" with a letter O, which then breaks every calculation that touches it.
A phone number stored as a number
The leading zero disappears, because 07700 is the number 7700.
This is the classic case where something that looks numeric must be stored as text — you never do arithmetic on it.
Money stored as float
Floats are approximate, so a long series of additions drifts by fractions of a penny.
Use decimal, which stores the exact value, whenever the total has to balance.
Consistency across tables: A foreign key must be the same type as the primary key it points at.
If StudentID is an integer in one table and text in another, joining them either fails or silently returns nothing.
How this is tested — you must name the type AND the specific problem the wrong choice would cause. It comes up two ways:
Paper 1 Section A
- Outline or choose data types for given columns, 2-4 marks
- State the effect of a wrong choice
- Explain why type consistency matters
Paper 1 Section B — case study
- Choose types for the case study's tables
- Identify a poor choice in a given design
The classic trap: Choosing a number type because the values look like digits. A phone number, a postcode and a product code are all text — the test is whether you would ever calculate with them.
A clinic stores: patient ID, date of birth, phone number and consultation fee. Outline a suitable data type for each, with a reason.
Model answer plan
See the answer broken into clear points, with guidance on how each point earns marks.