0984

Database Concepts

Databases · 5 question types

Exam Frequency Analysis

Past paper frequency (2018 to 2024)

This topic accounts for approximately 4% of your exam marks.

stable
Rare
Stable4%

SQL SELECT queries and database structure (tables, fields, records) appear as 4 to 6 mark questions.

When a table is created, each field is given a that says what kind of value it can hold. Choosing the right type makes the data smaller, faster and safer.

Data typeHoldsExample fields
IntegerWhole numbersAge, year of birth, ID number, quantity in stock
RealNumbers with a fractional partPrice, weight, percentage with decimals
Text / AlphanumericA sequence of charactersName, address, description
CharacterA single characterGender code ('M' or 'F'), grade letter
Date / TimeA specific calendar date or timeDate of birth, date joined, last-login timestamp
BooleanA simple true/false value"Has paid?" "Is active?" "Newsletter subscriber?"

Choosing the right type

For each field, ask three short questions in order:

  1. Does it ever need decimals? Yes → Real. No → keep going.
  2. Is it a count or whole-number ID? Yes → Integer. No → keep going.
  3. Is it just true or false? Yes → Boolean. Is it a date or timestamp? Yes → Date/Time. Is it exactly one character (a code or flag)? Yes → Character. Otherwise → Text / Alphanumeric.

Two common slips to avoid. Phone numbers and postcodes are stored as text, not integers: they may start with a leading zero, contain spaces or letters, and never have arithmetic done on them. Calendar dates are stored as a Date type, not as text: only a true date field can sort chronologically and reject impossible values like 2024-02-30.

Why the right data type matters

  • Memory efficiency: an integer takes less space than the same number stored as text.
  • Faster searching: numeric comparisons (>, <) work on numbers but not on text representations of numbers.
  • Validation: a date field rejects a value like "purple" automatically.
  • Sorting: a properly-typed date field sorts chronologically; the same date as text would sort alphabetically.