0984
Database Concepts
Databases · 5 question types
Exam Frequency Analysis
Past paper frequency (2018 to 2024)
This topic accounts for approximately 4% of your exam marks.
stable
Rare
Stable4%
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.
AND: every condition must be true
SELECT *
FROM Customers
WHERE Age > 18
AND City = 'New York';
Returns only customers who are both older than 18 and living in New York.
OR: at least one condition must be true
SELECT *
FROM Customers
WHERE City = 'London'
OR City = 'Paris';
Returns customers living in either London or Paris.
Multiple combined conditions
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.