Skip to content
2210 · 0478Paper 2 · Algorithms, Programming and Logic

9. Databases

Single-table databases: fields, records, data types, primary keys and SQL queries with SELECT, FROM, WHERE, ORDER BY, SUM and COUNT.

Statometer63CoreNext Paper 294%
Marks a paper9.1 · 12%Rank#9 of 10 · #3 on P2Trend · last 12Oct/Nov 24 · 23: 13 marksFeb/Mar 25 · 22: 11 marksMay/Jun 25 · 21: 7 marksMay/Jun 25 · 22: 12 marksMay/Jun 25 · 23: 8 marksOct/Nov 25 · 21: 10 marksOct/Nov 25 · 22: 10 marksOct/Nov 25 · 23: 5 marksFeb/Mar 26 · 22: 11 marksMay/Jun 26 · 21: 7 marksMay/Jun 26 · 22: 10 marksMay/Jun 26 · 23: 11 marks
9 in 10 chance in the next paper

Everything for this topic — study hub

O Level / IGCSE · 2210 · 0478 · Paper 2

Statometer — what 25 real papers say about this topic and each of its 4 syllabus bullets

Core · #9 of 10 in O Level / IGCSE · recomputed with every new session

63CORE
Core#9 of 10 in O Level / IGCSE#3 on Paper 2 Steady

A regular, well-paid topic — you cannot afford a gap here.

Next Paper 2
94%
9 in 10 chance it is set
Marks a paper
9.1 / 75
12% of Paper 2 · fair share 25%
Appeared in
25 / 25
Paper 2 sittings 20232026
Last set
May/Jun 2026
0478/23 · Q8 · 11 marks · 11-series streak
Marks in each of the last 12 Paper 2 sittingsOct/Nov 24May/Jun 26
Oct/Nov 24 · 23: 13 marksFeb/Mar 25 · 22: 11 marksMay/Jun 25 · 21: 7 marksMay/Jun 25 · 22: 12 marksMay/Jun 25 · 23: 8 marksOct/Nov 25 · 21: 10 marksOct/Nov 25 · 22: 10 marksOct/Nov 25 · 23: 5 marksFeb/Mar 26 · 22: 11 marksMay/Jun 26 · 21: 7 marksMay/Jun 26 · 22: 10 marksMay/Jun 26 · 23: 11 marks

What the papers say

  • Set in 25 of 25 Paper 2 sittings on the current syllabus — treat it as certain.
  • Worth about 9.1 marks a paper (12% of Paper 2, well under its fair share of 25%).
  • Last set May/Jun 2026 · 0478/23 · Q8 for 11 marks — in the most recent series.
  • Set in each of the last 11 series without a miss.
  • Steady at around 9.4 marks a paper year on year.
  • Lives on “Complete” and “State” — 71% of its questions: you must produce something — code, a diagram, a table — practise doing it, not reading it.
  • 42% of its questions involve a diagram, table or figure — practise with pen and paper.
  • 75% of its questions are set out as code, pseudocode or a table to complete.
  • Most of its marks (91%) come in extended questions of 6+ marks — plan the answer before writing.
  • Its biggest question so far: 11 marks (May/Jun 2026 · 0478/23 · Q8).
  • Inside the topic, Defining a single-table database from given storage requirements carries the most marks (36%) and Primary keys the least (10%).
  • It is examined mostly as AO1 (Knowledge & understanding, 63%), the rest AO2 (26%) — definitions and descriptions in syllabus words score.
  • The examiner has commented on 54 of its questions — read “What the examiner said” before you practise.

Command words

Share of questions using the word (a question can use several). What each wants →

Question shapes

  • 1–2 mk0
  • 3–4 mk4
  • 5–6 mk30
  • 7–9 mk41
  • 10+ mk18

Average 7.9 marks a question · 42% with a figure or table · 75% with code · biggest 11 marks

Assessment objectives — how it is examined

Every part of every current-syllabus question filed under Cambridge's AO1 / AO2 / AO3 (from its command word and what it asks you to do), so you know whether this topic pays for definitions, for applying, or for judging and building.

  • AO1 Knowledge & understanding
  • AO2 Apply to a context
  • AO3 Evaluate & judge

Paper 2 as a whole

Paper 2SyllabusMeasured
AO1 Knowledge & understanding20%27%
AO2 Apply to a context60%51%
AO3 Evaluate & judge20%22%

Syllabus = Cambridge's grid; measured = the bank's current-syllabus papers.

Inside the topic — every syllabus bullet, measured

Each part of each question is filed under the bullet it examines; the numbers are per Paper 2 sitting, exactly like the topic's. Open a bullet for its own Statometer.

  • Defining a single-table database from given storage requirements#17 of 19 on Paper 2Occasional · 3155% next paper1.1 marks15/25 sittings May/Jun 2026

    Rotated in occasionally — the bullet students skip and then meet.Syllabus: fields, records and validation

    Next Paper 2
    55%
    6 in 10
    Marks a paper
    1.1
    1% of the paper · 36% of the topic
    Asked in
    15 / 25
    Paper 2 sittings · 74 questions
    Last asked
    May/Jun 2026
    2210/22 · Q9 · 2 marks · 7-series streak
    • Asked in 15 of 25 Paper 2 sittings — about 6 papers in 10.
    • About 1.1 marks a paper (1% of Paper 2; 36% of the topic's marks across its 4 bullets).
    • Last asked May/Jun 2026 · 2210/22 · Q9 (2 marks) — in the most recent series.
    • Asked in each of the last 7 series.
    • Usually “Complete” or “State”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
    • It is examined mostly as AO1 (Knowledge & understanding, 74%) — definitions and descriptions in syllabus words score.
    Last 12 sittings Steady
    Oct/Nov 24 · 23: 3 marksFeb/Mar 25 · 22: 2 marksMay/Jun 25 · 21: 0 marksMay/Jun 25 · 22: 2 marksMay/Jun 25 · 23: 0 marksOct/Nov 25 · 21: 0 marksOct/Nov 25 · 22: 1 marksOct/Nov 25 · 23: 0 marksFeb/Mar 26 · 22: 2 marksMay/Jun 26 · 21: 0 marksMay/Jun 26 · 22: 2 marksMay/Jun 26 · 23: 0 marks

    Assessment objectives

    • AO1 Knowledge & understanding
    • AO2 Apply to a context
    • AO3 Evaluate & judge
    • Complete61%
    • State55%
    • Show54%
    • Give42%
  • Basic data types#13 of 19 on Paper 2Regular · 4166% next paper1.6 marks17/25 sittings May/Jun 2026

    Set most sessions for a few marks; know the definition and one example.Syllabus: text/alphanumeric, character, Boolean, integer, real, date/time

    Next Paper 2
    66%
    7 in 10
    Marks a paper
    1.6
    2% of the paper · 18% of the topic
    Asked in
    17 / 25
    Paper 2 sittings · 42 questions
    Last asked
    May/Jun 2026
    0478/23 · Q8 · 4 marks
    • Asked in 17 of 25 Paper 2 sittings — about 7 papers in 10.
    • About 1.6 marks a paper (2% of Paper 2; 18% of the topic's marks across its 4 bullets).
    • Last asked May/Jun 2026 · 0478/23 · Q8 (4 marks) — in the most recent series.
    • Rising: 1.3 → 2.1 marks a paper.
    • Usually “Complete” or “State”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
    • Biggest chunk of marks so far: 4 in May/Jun 2026 · 2210/22 · Q9.
    • It is examined mostly as AO1 (Knowledge & understanding, 58%), the rest AO2 (29%) — definitions and descriptions in syllabus words score.
    Last 12 sittings Rising
    Oct/Nov 24 · 23: 0 marksFeb/Mar 25 · 22: 0 marksMay/Jun 25 · 21: 2 marksMay/Jun 25 · 22: 2 marksMay/Jun 25 · 23: 4 marksOct/Nov 25 · 21: 2 marksOct/Nov 25 · 22: 1 marksOct/Nov 25 · 23: 0 marksFeb/Mar 26 · 22: 0 marksMay/Jun 26 · 21: 2 marksMay/Jun 26 · 22: 4 marksMay/Jun 26 · 23: 4 marks

    Assessment objectives

    • AO1 Knowledge & understanding
    • AO2 Apply to a context
    • AO3 Evaluate & judge
    • Complete76%
    • State69%
    • Show52%
    • Give48%
  • Primary keys#14 of 19 on Paper 2Regular · 4174% next paper1.3 marks20/25 sittings May/Jun 2026

    Set most sessions for a few marks; know the definition and one example.Syllabus: their purpose and identifying a suitable one for a table

    Next Paper 2
    74%
    7 in 10
    Marks a paper
    1.3
    2% of the paper · 10% of the topic
    Asked in
    20 / 25
    Paper 2 sittings · 43 questions
    Last asked
    May/Jun 2026
    0478/23 · Q8 · 2 marks · 3-series streak
    • Asked in 20 of 25 Paper 2 sittings — about 8 papers in 10.
    • About 1.3 marks a paper (2% of Paper 2; 10% of the topic's marks across its 4 bullets).
    • Last asked May/Jun 2026 · 0478/23 · Q8 (2 marks) — in the most recent series.
    • Usually “State” or “Complete”: short, precise answers in syllabus words.
    • It is examined mostly as AO1 (Knowledge & understanding, 52%), the rest AO3 (48%) — definitions and descriptions in syllabus words score.
    Last 12 sittings Steady
    Oct/Nov 24 · 23: 3 marksFeb/Mar 25 · 22: 2 marksMay/Jun 25 · 21: 0 marksMay/Jun 25 · 22: 0 marksMay/Jun 25 · 23: 0 marksOct/Nov 25 · 21: 2 marksOct/Nov 25 · 22: 1 marksOct/Nov 25 · 23: 2 marksFeb/Mar 26 · 22: 1 marksMay/Jun 26 · 21: 2 marksMay/Jun 26 · 22: 0 marksMay/Jun 26 · 23: 2 marks

    Assessment objectives

    • AO1 Knowledge & understanding
    • AO2 Apply to a context
    • AO3 Evaluate & judge
    • State79%
    • Complete79%
    • Give65%
    • Show51%
  • SQL scripts on a single table#5 of 19 on Paper 2Banker · 8294% next paper5.1 marks25/25 sittings May/Jun 2026

    Asked in nearly every paper — the bullet to know cold.Syllabus: SELECT, FROM, WHERE, ORDER BY (ASCENDING/DESCENDING), SUM, COUNT, AND, OR — and working out the output of a query

    Next Paper 2
    94%
    9 in 10
    Marks a paper
    5.1
    7% of the paper · 36% of the topic
    Asked in
    25 / 25
    Paper 2 sittings · 75 questions
    Last asked
    May/Jun 2026
    0478/23 · Q8 · 5 marks · 11-series streak
    • Asked in 25 of 25 Paper 2 sittings — nearly every paper.
    • About 5.1 marks a paper (7% of Paper 2; 36% of the topic's marks across its 4 bullets).
    • Last asked May/Jun 2026 · 0478/23 · Q8 (5 marks) — in the most recent series.
    • Asked in each of the last 11 series.
    • Rising: 4.5 → 5.4 marks a paper.
    • Usually “Complete” or “State”: you must produce something — code, a diagram, a table — practise doing it, not reading it.
    • Biggest chunk of marks so far: 8 in Feb/Mar 2026 · 0478/22 · Q8.
    • It is examined mostly as AO1 (Knowledge & understanding, 64%), the rest AO2 (36%) — definitions and descriptions in syllabus words score.
    Last 12 sittings Rising
    Oct/Nov 24 · 23: 7 marksFeb/Mar 25 · 22: 7 marksMay/Jun 25 · 21: 5 marksMay/Jun 25 · 22: 8 marksMay/Jun 25 · 23: 4 marksOct/Nov 25 · 21: 6 marksOct/Nov 25 · 22: 7 marksOct/Nov 25 · 23: 3 marksFeb/Mar 26 · 22: 8 marksMay/Jun 26 · 21: 3 marksMay/Jun 26 · 22: 4 marksMay/Jun 26 · 23: 5 marks

    Assessment objectives

    • AO1 Knowledge & understanding
    • AO2 Apply to a context
    • AO3 Evaluate & judge
    • Complete63%
    • State59%
    • Show45%
    • Give41%

7% of the topic's marks sit in question parts that belong to another topic (scenario questions cross sections) or that no bullet claims; they count for the topic, not for a bullet.

Marks a paper, year by year

1011121314151617181920212223242526

Grey years are the previous syllabus (20102022, 65 questions) — history, not counted in the rates.

By exam series

  • Feb/Mar4/4 · 9.8 mk
  • May/Jun12/12 · 8.4 mk
  • Oct/Nov9/9 · 9.4 mk

What you need to know4syllabus section 9

  1. Defining a single-table database from given storage requirementsfields, records and validation
  2. Basic data typestext/alphanumeric, character, Boolean, integer, real, date/time
  3. Primary keystheir purpose and identifying a suitable one for a table
  4. SQL scripts on a single tableSELECT, FROM, WHERE, ORDER BY (ASCENDING/DESCENDING), SUM, COUNT, AND, OR — and working out the output of a query

Video lectures9ZAK's YouTube channel · play here

  • O Level20222.2K views

  • O Level2022714 views

  • O Level20201.3K views

  • O Level20203.5K views

  • O LevelAS20202.4K views

  • O LevelASA220202.3K views

Infographics1draw these the way the examiner expects · download as PNG

Single-table database & SQLField = column (one item of data). Record = row (one entity). Primary key = the field that uniquelyidentifies each record.STUDENTStudentIDNameFormMarkS001Ali10A82S002Hina10B64S003Omar10A91S004Sara10B70StudentID = primary key (unique, never blank).Data types: text, character, Boolean, integer, real, date/time.SELECT Name, MarkFROM STUDENTWHERE Mark >= 70ORDER BY Mark DESC;NameMarkOmar91Ali82Sara70result: 3 records,2 fields, sortedhighest firstAggregatesSELECT COUNT(*) FROM STUDENT WHERE Form = "10A"; → 2SELECT SUM(Mark) FROM STUDENT; → 307ClauseMeaningSELECTwhich fields to show (* = all)FROMwhich tableWHEREcondition: = < > <= >= <> AND ORORDER BYsort: ASC (default) or DESCValidation on fields: range, type, length,format, presence, check digit.Strings in quotes; the semicolon ends the statement.Field names in SELECT are separated by commas.cswithzak.com

Single-table database & SQL

O LevelAS

Browse all infographics →

Key terms10use these exact words in the exam

databasefieldrecordprimary keySQLSELECTWHEREORDER BYCOUNTSUM

Dotted terms are defined in the glossary.

Code help2referenced to the Cambridge pseudocode guide

SELECT with WHERE and ORDER BY

sql Run in SQL Lab
SELECT Name, Mark
FROM STUDENT
WHERE Form = "10B" AND Mark > 70
ORDER BY Mark DESC;

SUM and COUNT

sql Run in SQL Lab
SELECT SUM(Mark)
FROM STUDENT
WHERE Form = "10B";
 
SELECT COUNT(*)
FROM STUDENT
WHERE Mark >= 50;

SQL Lab13runnable queries against the ZAK Academy database

  • SELECT * — every column of a table

    The simplest query. Look at the STUDENT table first, then pick columns.

    O LevelASSELECT & FROM 2210 §9.2 / 9618 §8.3
    Run
  • Choose the columns you want

    Name the fields, separated by commas — the result has only those columns, in that order.

    O LevelASSELECT & FROM 2210 §9.2
    Run
  • WHERE with a text value

    Text is written in single quotes. Only rows where the condition is TRUE are returned.

    O LevelASWHERE 2210 §9.2
    Run
  • WHERE with a number and a comparison

    Numbers have no quotes. > >= < <= = <> all work.

    O LevelASWHERE 2210 §9.2
    Run
  • AND, OR and brackets

    AND binds tighter than OR — use brackets to say what you mean, exactly as in Boolean logic.

    O LevelASWHERE 2210 §9.2
    Run
  • ORDER BY ascending

    Alphabetical by last name — ASC is the default.

    O LevelASORDER BY 2210 §9.2
    Run
  • ORDER BY descending, two keys

    Highest salary first; ties broken by last name. LIMIT keeps the top few.

    O LevelASORDER BY 2210 §9.2
    Run
  • WHERE then ORDER BY

    Filter first, then sort — the clause order is fixed: SELECT … FROM … WHERE … ORDER BY.

    O LevelASORDER BY 2210 §9.2
    Run
  • COUNT(*) — how many rows

    How many students are in form 10A? COUNT(*) counts matching rows.

    O LevelASCOUNT, SUM, AVG, MIN, MAX 2210 §9.2
    Run
  • SUM — total of a column

    Total monthly salary bill for the Computer Science department.

    O LevelASCOUNT, SUM, AVG, MIN, MAX 2210 §9.2
    Run
  • 2210: names and marks of students who scored over 70 in CSO-A, highest first

    Single-table query with WHERE, AND and ORDER BY — the classic 2210 Paper 2 SQL question.

    O LevelExam-style questions 2210 §9.2
    Run
  • 2210: how many books were published after 2015?

    COUNT with a WHERE — the 2210 syllabus expects SUM and COUNT.

    O LevelExam-style questions 2210 §9.2
    Run
  • 2210: total copies of books by an author

    SUM over a filtered set.

    O LevelExam-style questions 2210 §9.2
    Run

Database Designer3normalisation questions checked dependency by dependency, ER diagrams and table designs

  • Sports club members

    Design the table: a member ID, name, date of birth, phone number, membership type and whether the fee is paid.

    O LevelSingle-table design (2210) 2210 §9
    Open
  • Shop stock

    Products with a code, description, price, stock level and reorder flag.

    O LevelSingle-table design (2210) 2210 §9
    Open
  • Driving lessons

    Lesson records: number, date, instructor, student name, duration and paid — where is the primary key?

    O LevelSingle-table design (2210) 2210 §9
    Open

Test yourself

Ready to check you know it?

Every round is a fresh random draw, weak cards come back until you get them right, and past-paper questions come with their mark schemes. Marks earn XP on your dashboard.

Enroll nowOnline classes