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
A number stored as text
A phone number stored as a number
Money stored as float
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 mark-by-mark plan — for / against / judgement, with marking guidance — in study mode.