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.
When a WHERE clause needs to test more than one condition, AND and OR combine them, exactly like in topic 21.
SELECT *
FROM Customers
WHERE Age > 18
AND City = 'New York';
Returns only customers who are both older than 18 and living in New York.
SELECT *
FROM Customers
WHERE City = 'London'
OR City = 'Paris';
Returns customers living in either London or Paris.
SELECT *
FROM Customers
WHERE (Age > 30 AND Country = 'USA')
OR Country = 'France';
Returns customers who are either over-30 USA residents, or any customer from France. Brackets make the meaning unambiguous.