Databases · 5 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 4% of your exam marks.
SQL SELECT queries and database structure (tables, fields, records) appear as 4 to 6 mark questions.
Conditions inside WHERE use comparison operators, much like the ones in topic 21.
| Operator | Meaning | Example |
|---|---|---|
= | Equal to | WHERE City = 'London' |
<> | Not equal to | WHERE Country <> 'France' |
< | Less than | WHERE Age < 18 |
> | Greater than | WHERE Salary > 30000 |
<= | Less than or equal to | WHERE Mark <= 40 |
>= | Greater than or equal to | WHERE Age >= 18 |
Text values are wrapped in single quotes ('London', 'M'); numbers are written without quotes (30, 40000).
Common slip: writing
WHERE City = London(without quotes) makes the database look for a column calledLondon, which does not exist, and the query fails. Always quote text values.