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.

A WHERE condition often needs to match a pattern in text rather than an exact value. SQL uses the LIKE keyword with the % wildcard, which stands for "any sequence of characters" (including no characters at all).

PatternMeaning
'J%'Starts with "J" (e.g. "John", "Jane", "Jake")
'%son'Ends with "son" (e.g. "Johnson", "Wilson")
'%ar%'Contains "ar" anywhere (e.g. "Mary", "Carter", "Bar")
'_'Underscore matches exactly one character (e.g. 'M_n' matches "Man" or "Min")

Pattern: countries starting with C

SELECT Name, Country
FROM Customers
WHERE Country LIKE 'C%';

For the table from section 6, this returns:

NameCountry
Maya HassanCanada

The other three records (Ireland, Japan, India) are excluded because their country names do not start with C.

Pattern: names containing "as"

SELECT Name
FROM Customers
WHERE Name LIKE '%as%';

Returns Maya Hassan. The % on both sides means "as" can appear anywhere in the name.