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)
Data types, validation, comparison operators, and ordered tabular data.
This is a single-table syllabus. Trace the actual rows and output order instead of describing a query only in general terms.
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
| Idea | Precise role | Evidence or example |
|---|---|---|
| single-table database | stores all required records in one table | one Students table |
| field | one attribute or category stored for every record | DateOfBirth |
| record | all field values about one item or entity | one student's row |
| data requirement | states what values must be stored and used | store each product's code and price |
| database validation | checks whether entered field data is sensible and follows rules | range check on a mark field |
| table definition | selects fields, data types, validation, and a suitable primary key | designing a membership table |
Four-step exam routine
Identify the exact clue and name single-table database only when its defining role fits.
State the mechanism or boundary: one attribute or category stored for every record.
Apply the idea to evidence such as “one student's row.”
Reject the tempting error that is chosen after the table is built.
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.
table is the best match when the scenario clue is 'store member details'.
| Scenario clue | What it proves |
|---|---|
| store member details | table |
| store one detail type | field |
| store one member | record |
| reject bad input | validation |
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.
| Term | Use in this lesson |
|---|---|
| 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 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.
| Mistake | Correction |
|---|---|
| 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. |
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
| Idea | Precise role | Evidence or example |
|---|---|---|
| text/alphanumeric | stores letters, digits, and symbols not used for arithmetic | product code A104 |
| character | stores one character | grade 'A' |
| database Boolean type | stores TRUE or FALSE in a field | Paid |
| database integer type | stores whole numbers in a field | Quantity 12 |
| database real type | stores a field number with a fractional part | Mass 4.75 |
| date/time | stores a calendar date and/or time value | appointment timestamp |
Four-step exam routine
Identify the exact clue and name text/alphanumeric only when its defining role fits.
State the mechanism or boundary: stores one character.
Apply the idea to evidence such as “Paid.”
Reject the tempting error that stores 12.75 exactly.
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.
real is the best match when the scenario clue is 'store price'.
| Scenario clue | What it proves |
|---|---|
| store price | real |
| store stock count | integer |
| store member status | Boolean |
| store phone number | text/string |
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.
| Term | Use in this lesson |
|---|---|
| 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 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.
| Mistake | Correction |
|---|---|
| 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. |
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
| Idea | Precise role | Evidence or example |
|---|---|---|
| primary key | a field whose value uniquely identifies each record | StudentID |
| unique | no two records share the same primary-key value | membership number |
| non-null | every record must have a primary-key value | each product has a ProductID |
| stable identifier | less likely to change than descriptive personal data | CustomerID instead of surname |
| unsuitable key | can duplicate, change, or be missing | first name |
| record retrieval | uses a primary-key value to locate one exact record | find OrderID 8274 |
Four-step exam routine
Identify the exact clue and name primary key only when its defining role fits.
State the mechanism or boundary: no two records share the same primary-key value.
Apply the idea to evidence such as “each product has a ProductID.”
Reject the tempting error that uses a person's age.
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.
primary key is the best match when the scenario clue is 'identify one record'.
| Scenario clue | What it proves |
|---|---|
| identify one record | primary key |
| choose from possible keys | candidate key |
| unique only when combined | composite key |
| avoid duplicates | unique values |
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.
| Term | Use in this lesson |
|---|---|
| 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 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.
| Mistake | Correction |
|---|---|
| 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. |
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
| Idea | Precise role | Evidence or example |
|---|---|---|
| SELECT clause | states the field or aggregate values to return | SELECT Name, Score |
| FROM clause | states the single table that supplies the records | FROM Students |
| WHERE clause | filters records using a condition | WHERE Score >= 70 |
| AND and OR conditions | require both filter conditions or at least one filter condition respectively | Age >= 16 AND Paid = TRUE |
| ORDER BY | sorts the query output in ASCENDING or DESCENDING order | ORDER BY Score DESCENDING |
| SUM and COUNT | return a total of numeric values or the number of matching records | SELECT SUM(Score) FROM Students or SELECT COUNT(*) FROM Students |
Four-step exam routine
Identify the exact clue and name SELECT clause only when its defining role fits.
State the mechanism or boundary: states the single table that supplies the records.
Apply the idea to evidence such as “WHERE Score >= 70.”
Reject the tempting error that perform numeric addition.
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.
SELECT is the best match when the scenario clue is 'return Name'.
| Scenario clue | What it proves |
|---|---|
| return Name | SELECT |
| use Students table | FROM |
| Class = '10A' | WHERE |
| highest first | ORDER BY ... DESC |
| count rows | COUNT |
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.
| Term | Use in this lesson |
|---|---|
| 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 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.
| Mistake | Correction |
|---|---|
| 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. |
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
- Name: use the exact syllabus term.
- Role: define what that term does or represents.
- Mechanism: describe the relevant steps in their logical order.
- Context: explain why that mechanism matters in the stated scenario.
- Boundary: avoid claiming more than the method guarantees.
Last-pass checklist
Mapped to Cambridge IGCSE Computer Science 0478 · 2026–2028 syllabus, version 5