IGCSE Computer Science · Study guide

Databases

IGCSE Computer Science · Comprehensive Guide 9

Topic 9 · Databases

Design one-table data storage, select field types and a primary key, then read and write the required SQL subset.

4 lesson sections · 4 worked applications · Paper 2 · Cambridge 0478 (2026–2028)

Prerequisite check

Data types, validation, comparison operators, and ordered tabular data.

Exam reasoning lens

This is a single-table syllabus. Trace the actual rows and output order instead of describing a query only in general terms.

Topic 9 · Section 1

Single-table Databases

The defining description of single-table database is “stores all required records in one table.” Connect it with field, whose role is “one attribute or category stored for every record.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
single-table databasestores all required records in one tableone Students table
fieldone attribute or category stored for every recordDateOfBirth
recordall field values about one item or entityone student's row
data requirementstates what values must be stored and usedstore each product's code and price
database validationchecks whether entered field data is sensible and follows rulesrange check on a mark field
table definitionselects fields, data types, validation, and a suitable primary keydesigning a membership table

Four-step exam routine

1

Identify the exact clue and name single-table database only when its defining role fits.

2

State the mechanism or boundary: one attribute or category stored for every record.

3

Apply the idea to evidence such as “one student's row.”

4

Reject the tempting error that is chosen after the table is built.

Method and reasoning

Reason Before Naming

These terms are usually assessed through short scenarios, so the mark often comes from matching the clue rather than recalling a definition alone.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
table is the best match when the scenario clue is 'store member details'.
Scenario clueWhat it proves
store member detailstable
store one detail typefield
store one memberrecord
reject bad inputvalidation
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • database: organised collection of data
  • table: grid of related data
  • field: column storing one category of data
  • record: row storing all data for one item
  • validation: automatic check on input data

A strong answer names the idea, quotes or paraphrases the clue, and explains the link in one sentence.

TermUse in this lesson
databaseorganised collection of data
tablegrid of related data
fieldcolumn storing one category of data
recordrow storing all data for one item
validationautomatic check on input data
Boundary and misconception

A Common Mix-Up

A common mistake is stopping at a broad Single-table Databases word instead of proving the answer from the clue.

Fix: Underline the clue first, then choose the term that explains that exact clue.

MistakeCorrection
A common mistake is stopping at a broad Single-table Databases word instead of proving the answer from the clue.Underline the clue first, then choose the term that explains that exact clue.
Topic 9 · Section 2

Database Data Types

The defining description of text/alphanumeric is “stores letters, digits, and symbols not used for arithmetic.” Connect it with character, whose role is “stores one character.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
text/alphanumericstores letters, digits, and symbols not used for arithmeticproduct code A104
characterstores one charactergrade 'A'
database Boolean typestores TRUE or FALSE in a fieldPaid
database integer typestores whole numbers in a fieldQuantity 12
database real typestores a field number with a fractional partMass 4.75
date/timestores a calendar date and/or time valueappointment timestamp

Four-step exam routine

1

Identify the exact clue and name text/alphanumeric only when its defining role fits.

2

State the mechanism or boundary: stores one character.

3

Apply the idea to evidence such as “Paid.”

4

Reject the tempting error that stores 12.75 exactly.

Method and reasoning

Reason Before Naming

These terms are usually assessed through short scenarios, so the mark often comes from matching the clue rather than recalling a definition alone.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
real is the best match when the scenario clue is 'store price'.
Scenario clueWhat it proves
store pricereal
store stock countinteger
store member statusBoolean
store phone numbertext/string
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • text/string: letters, digits, or symbols treated as text
  • integer: whole number
  • real: decimal number
  • Boolean: TRUE or FALSE value
  • date/time: calendar date or clock time

A strong answer names the idea, quotes or paraphrases the clue, and explains the link in one sentence.

TermUse in this lesson
text/stringletters, digits, or symbols treated as text
integerwhole number
realdecimal number
BooleanTRUE or FALSE value
date/timecalendar date or clock time
Boundary and misconception

A Common Mix-Up

A common mistake is stopping at a broad Database Data Types word instead of proving the answer from the clue.

Fix: Underline the clue first, then choose the term that explains that exact clue.

MistakeCorrection
A common mistake is stopping at a broad Database Data Types word instead of proving the answer from the clue.Underline the clue first, then choose the term that explains that exact clue.
Topic 9 · Section 3

Primary Keys

The defining description of primary key is “a field whose value uniquely identifies each record.” Connect it with unique, whose role is “no two records share the same primary-key value.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
primary keya field whose value uniquely identifies each recordStudentID
uniqueno two records share the same primary-key valuemembership number
non-nullevery record must have a primary-key valueeach product has a ProductID
stable identifierless likely to change than descriptive personal dataCustomerID instead of surname
unsuitable keycan duplicate, change, or be missingfirst name
record retrievaluses a primary-key value to locate one exact recordfind OrderID 8274

Four-step exam routine

1

Identify the exact clue and name primary key only when its defining role fits.

2

State the mechanism or boundary: no two records share the same primary-key value.

3

Apply the idea to evidence such as “each product has a ProductID.”

4

Reject the tempting error that uses a person's age.

Method and reasoning

Reason Before Naming

These terms are usually assessed through short scenarios, so the mark often comes from matching the clue rather than recalling a definition alone.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
primary key is the best match when the scenario clue is 'identify one record'.
Scenario clueWhat it proves
identify one recordprimary key
choose from possible keyscandidate key
unique only when combinedcomposite key
avoid duplicatesunique values
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • primary key: field that uniquely identifies each record
  • candidate key: field that could be chosen as a primary key
  • composite key: key made from two or more fields
  • unique: not repeated in the table

A strong answer names the idea, quotes or paraphrases the clue, and explains the link in one sentence.

TermUse in this lesson
primary keyfield that uniquely identifies each record
candidate keyfield that could be chosen as a primary key
composite keykey made from two or more fields
uniquenot repeated in the table
Boundary and misconception

A Common Mix-Up

A common mistake is stopping at a broad Primary Keys word instead of proving the answer from the clue.

Fix: Underline the clue first, then choose the term that explains that exact clue.

MistakeCorrection
A common mistake is stopping at a broad Primary Keys word instead of proving the answer from the clue.Underline the clue first, then choose the term that explains that exact clue.
Topic 9 · Section 4

SQL Queries

The defining description of SELECT clause is “states the field or aggregate values to return.” Connect it with FROM clause, whose role is “states the single table that supplies the records.”

Required vocabulary and boundaries

IdeaPrecise roleEvidence or example
SELECT clausestates the field or aggregate values to returnSELECT Name, Score
FROM clausestates the single table that supplies the recordsFROM Students
WHERE clausefilters records using a conditionWHERE Score >= 70
AND and OR conditionsrequire both filter conditions or at least one filter condition respectivelyAge >= 16 AND Paid = TRUE
ORDER BYsorts the query output in ASCENDING or DESCENDING orderORDER BY Score DESCENDING
SUM and COUNTreturn a total of numeric values or the number of matching recordsSELECT SUM(Score) FROM Students or SELECT COUNT(*) FROM Students

Four-step exam routine

1

Identify the exact clue and name SELECT clause only when its defining role fits.

2

State the mechanism or boundary: states the single table that supplies the records.

3

Apply the idea to evidence such as “WHERE Score >= 70.”

4

Reject the tempting error that perform numeric addition.

Method and reasoning

Reason Before Naming

These terms are usually assessed through short scenarios, so the mark often comes from matching the clue rather than recalling a definition alone.

Start by underlining the clue in the scenario, then decide what job that clue is describing. This keeps the answer tied to the concept being assessed.

Answer pattern
SELECT is the best match when the scenario clue is 'return Name'.
Scenario clueWhat it proves
return NameSELECT
use Students tableFROM
Class = '10A'WHERE
highest firstORDER BY ... DESC
count rowsCOUNT
Worked application

When The Scenario Is Less Obvious

The question may include a boundary case or a tempting wrong answer. Use the exact role in the scenario as evidence.

  • SELECT: clause that chooses fields to return
  • FROM: clause that names the table
  • WHERE: clause that filters records
  • ORDER BY: clause that sorts results
  • COUNT: function that counts records

A strong answer names the idea, quotes or paraphrases the clue, and explains the link in one sentence.

TermUse in this lesson
SELECTclause that chooses fields to return
FROMclause that names the table
WHEREclause that filters records
ORDER BYclause that sorts results
COUNTfunction that counts records
Boundary and misconception

A Common Mix-Up

A common mistake is stopping at a broad SQL Queries word instead of proving the answer from the clue.

Fix: Underline the clue first, then choose the term that explains that exact clue.

MistakeCorrection
A common mistake is stopping at a broad SQL Queries word instead of proving the answer from the clue.Underline the clue first, then choose the term that explains that exact clue.
Paper 2 response lab

Turn knowledge into marks

A high-quality response does more than recall a term. It selects the command word, states the exact role, follows the mechanism in order, and connects the effect to the scenario.

Define precisely

For single-table database, begin with the defining role: stores all required records in one table. Do not replace the definition with an example.

Describe a process

Use an ordered chain. Name what enters, what changes or is checked, and what result follows. A useful anchor here is “one student's row.”

Apply or justify

Quote the scenario need, select ORDER BY, then link its role — sorts the query output in ASCENDING or DESCENDING order — to the required outcome.

Repair a misconception

Do not accept the claim that create a second linked table. Replace it with the exact boundary: return a total of numeric values or the number of matching records.

Mark-by-mark response ladder

  1. Name: use the exact syllabus term.
  2. Role: define what that term does or represents.
  3. Mechanism: describe the relevant steps in their logical order.
  4. Context: explain why that mechanism matters in the stated scenario.
  5. Boundary: avoid claiming more than the method guarantees.

Last-pass checklist

Single-table Databasessingle-table database — stores all required records in one table.
Database Data Typestext/alphanumeric — stores letters, digits, and symbols not used for arithmetic.
Primary Keysprimary key — a field whose value uniquely identifies each record.
SQL QueriesSELECT clause — states the field or aggregate values to return.

Mapped to Cambridge IGCSE Computer Science 0478 · 2026–2028 syllabus, version 5