Databases and SQL – O Level Computer Science (2210)

44 questions · page 1 of 3 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
2210/21/M/J/26 · Question 9May/June 2026Paper 217 marks
Loading question…
Question text

9
A swimming club wants to set up a new database table to store details of the members of the
club and the maximum distance each member swam in metres.
The table is called SWIMMERS and will contain these fields:
•
Distance – distance the member swam, for example 1500
•
Date – date the member swam the distance
•
Time – time taken to swim the distance
•
MemberID – the code to identify a member, for example TH749
•
MemberName – name of the member.
(a) (i)
State why MemberName would not be appropriate for a primary key.
…
… [1]
(ii)
Give the name of the most appropriate field for the primary key.
…
… [1]
(b) Complete the table to identify the most appropriate data type for these fields in the
table SWIMMERS. Each data type must be different.
field
data type
Distance
Date
MemberID
[2]
(c) Complete the structured query language (SQL) statement to display only the names of the
members who swam a distance of 1500 metres or more.
SELECT …
FROM …
WHERE …
… ;
[3]
© Cambridge University Press & Assessment 2026
,
,
© Cambridge University Press & Assessment 2026

2
2210/22/M/J/26 · Question 9May/June 2026Paper 2210 marks
Loading question…
Question text

9
(a) A database table CAR_PARTS stores details of car parts that a business has in stock.
Complete the table by giving the most appropriate data types for each field.
Only the data types: text, character, Boolean, integer, real and date/time are available in
this database.
field
data type
description
unique code to identify the car
PartID
part with letters and numbers
name of the car part, for example
PartName
windscreen wiper
four-digit number code to
CarType
represent the type of car
Price
selling price to 2 decimal places
specifies the size if relevant,
Size
otherwise stores ‘one size’
single letter code for the colour of
Colour
the car part
NumberInStock
the quantity of car parts in stock
whether or not the car part is
InStock
in stock
[4]
(b) Complete the structured query language (SQL) statement to list only the part ID, type of car
and the quantity in stock of all the car parts that are brake pads.
SELECT …
FROM …
WHERE … ;
[4]
(c) Describe one reason why the InStock field is not needed in the table.
…
…
…
… [2]
© Cambridge University Press & Assessment 2026
,
,
© Cambridge University Press & Assessment 2026

3
2210/22/O/N/25 · Question 7Oct/Nov 2025Paper 2210 marks
Loading question…
Question text

7
A database table WATERFOWL stores some details of a range of birds found in the UK that live on
or near water. The length and wingspan dimensions are in centimetres and the typical lifespan is
in years.
Species
Family
Length
Wingspan
CoastalHabitat
Lifespan
Barnacle goose
Goose
63.5
130.0
FALSE
14
Bewick’s swan
Swan
120.2
190.5
TRUE
8
Brent goose
Goose
58.0
94.3
TRUE
11
Canada goose
Goose
78.5
160.0
FALSE
6
Eider
Duck
58.0
94.5
TRUE
8
Goldeneye
Duck
44.5
72.1
TRUE
6
Goosander
Duck
63.3
90.0
TRUE
7
Long‑tailed duck
Duck
44.0
76.6
TRUE
5
Mallard
Duck
59.7
90.8
FALSE
3
Mute swan
Swan
150.0
220.2
FALSE
10
Pink‑footed goose
Goose
69.6
150.0
TRUE
8
Pintail
Duck
60.0
88.6
TRUE
3
Smew
Duck
41.5
62.1
FALSE
7
White‑fronted goose
Goose
71.5
140.0
FALSE
6
Whooper swan
Swan
150.0
230.0
TRUE
9
(a) State the purpose of a primary key in a database table.
…
… [1]
(b) Complete the table for each of the given data types, to identify one field from the table
WATERFOWL that is most likely to use it.
Each field must be different.
Data type
Field
Boolean
Integer
Real
Text
[2]
ĬÑĊ®Ġ´íÈõÏĪÅĊÞú·þ×
,
,
(c) Give the output that would be produced by the structured query language (SQL) statement:
SELECT Species, Length, Wingspan
FROM WATERFOWL
WHERE Family = "Swan"
ORDER BY Lifespan;
…
…
…
…
…
… [3]
(d) Complete the SQL statement to list only the species, family and lifespan of all waterfowl
whose typical lifespan is at least 10 years, sorted in order of species.
SELECT …
…
…
… [4]
ĬÓĊ®Ġ´íÈõÏĪÅĊÞü·þ×

Advertisement
4
2210/23/O/N/25 · Question 8Oct/Nov 2025Paper 235 marks
Loading question…
Question text

8
A school has set up a database table EquipmentLoan to record details of school equipment
loaned to students.
EquipmentID
Description
Name
DateLoaned
Returned
Cam01
Digital camera
James
23/04/2025
No
Cam04
Digital camera
Amir
12/03/2025
Yes
Gra02
Graphics tablet
Nikita
27/04/2025
No
Tab01
Tablet
Holly
18/03/2025
Yes
Ext01
External Hard drive
Hussein
27/04/2025
Yes
Cam02
Digital camera
Emily
10/04/2025
Yes
Tri01
Tripod
Emily
10/04/2025
Yes
(a) (i)
Give the name of the field that is most appropriate to be the primary key.
… [1]
(ii)
State the reason for choosing this field for the primary key.
…
… [1]
(b) Complete the structured query language (SQL) statement to list equipment not returned.
The list must contain only the descriptions and student names.
SELECT …
FROM …
WHERE … ;
[3]
ĬÑĊ®Ġ´íÈõÏĪÅĊßù¸þ×

5
2210/21/M/J/25 · Question 8May/June 2025Paper 217 marks
Loading question…
Question text

8
A bus company has set up a new database table called BUS to store details of the buses leaving
the main bus terminal.
RouteID
Destination
Stops
Driver
Time
Return
BC01
Town Centre
10
B Smith
9:00
Yes
BC02
The Fountain
5
A Patel
9:10
Yes
BC03
The Palace
9
B Hayes
9:28
No
BC04
City Park
12
W Gao
9:55
Yes
BC05
City Mall
9
R Hussein
10:10
No
BC06
Swan Lake
14
S Clarke
10:33
No
BC07
Guildhall Square
7
J Page
11:34
No
BC08
Sunset Quay
6
A Patel
12:01
Yes
BC10
Fort Worthington
15
E Carr
12:01
Yes
BC12
The Observatory
18
B Smith
13:27
No
BC14
East Seaport
11
B Scott
14:07
No
BC15
The Football Ground
12
J Page
14:46
Yes
BC19
The Cricket Ground
11
B Hayes
15:14
No
BC23
Temple Ruins
14
W Gao
16:16
No
BC27
The University
9
A Patel
16:45
No
(a) (i)
Identify one appropriate data type for the field Return
… [1]
(ii)
State the reason for the data type chosen.
…
… [1]
(b) Write the output from the structured query language (SQL) statement:
SELECT RouteID, Destination, Time
FROM BUS
WHERE Driver = "A Patel";
…
…
…
…
… [2]
ĬÑĊ®Ġ´íÈõÏĪÅĊßù¶Ā×
,
,
(c) Complete the SQL statement to display only the destination of the buses that have a return.
SELECT …
…
…
… [3]

6
2210/22/M/J/25 · Question 9May/June 2025Paper 226 marks
Loading question…
Question text

A database table, CapitalCity, stores data about capital cities from around the world.
9
Field
Description
Identification
a unique identifier
Name
the name of the city
Country
the name of the country in which the city is located
Continent
the name of the continent in which the city is located
Population
the number of people living in the city
Founded
the year the city was founded
AverageIncome
average income of the city’s population, in $, rounded to 2 decimal places
Subway
whether or not the city has an underground railway system
(a) Complete the table by writing one appropriate field from CapitalCity for each data type.
Each field must be different.
Data type
Field
Boolean
integer
real
text
[2]
(b) Complete the structured query language (SQL) statement to list only the name, country and
population of all the cities in CapitalCity from the continent of Asia.
SELECT …
… CapitalCity
WHERE … = … ;
[4]
Due to an issue with Question 10, the question has been removed from the question paper.
Permission to reproduce items where third-party owned material protected by copyright is included has been sought and cleared where possible. Every
publisher will be pleased to make amends at the earliest possible opportunity.
To avoid the issue of disclosure of answer-related information to candidates, all copyright acknowledgements are reproduced online in the Cambridge
Assessment International Education Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download
at www.cambridgeinternational.org after the live examination series.
Cambridge Assessment International Education is part of Cambridge Assessment. Cambridge Assessment is the brand name of the University of Cambridge

7
2210/22/O/N/24 · Question 11Oct/Nov 2024Paper 228 marks
Loading question…
Question text

11
A database table called Booking28 stores details of hotel rooms and bookings for the week
beginning Monday 7 July 2025.
RoomNo
Type
Guests
Rate$
Mon
Tue
Wed
Thu
Fri
Sat
Sun
101D
Double
2
99.99
T
T
T
T
F
T
T
102D
Double
2
99.99
T
T
T
F
T
T
T
103F
Family
4
150.00
T
T
T
T
T
T
T
104S
Single
1
72.50
F
T
T
F
T
T
T
105S
Single
1
72.50
F
T
T
F
T
T
T
106T
Twin
2
120.00
T
T
T
T
F
T
T
201F
Family
4
160.00
F
F
T
T
T
T
T
202D
Double
2
120.00
T
F
T
T
T
T
T
203T
Twin
2
120.00
T
F
T
T
T
T
T
204T
Twin
2
125.00
T
F
T
F
T
T
T
205S
Single
1
79.99
T
F
T
T
F
T
T
301D
Double
2
200.00
F
T
T
F
F
T
T
302T
Twin
2
200.00
T
T
T
T
F
T
T
303P
Suite
4
500.00
T
T
T
T
F
T
T
304P
Suite
6
700.00
F
F
F
F
T
T
T
(a) State the number of fields and records in this database table.
Fields …
Records …
[2]
(b) State the reason why the Type field would not be suitable as a primary key.
…
… [1]
ĬÑĊ®Ġ´íÈõÏĪÅĊÞù¸þ×
,
,
(c) The database uses only the data types:
•
alphanumeric
•
character
•
Boolean
•
integer
•
real
•
date/time.
Complete the table to show the fields that could have the given data types.
Only one field name is required in each box and each field name must be different.
Field
Data type
alphanumeric
Boolean
real
integer
[2]
(d) Give the output that would be produced by the structured query language (SQL) statement:
SELECT RoomNo, Type, Guests, Rate$
FROM Booking28
WHERE Mon <> T;
…
…
…
…
…
… [3]
ĬÓĊ®Ġ´íÈõÏĪÅĊÞû¸þ×

8
2210/23/O/N/24 · Question 4Oct/Nov 2024Paper 236 marks
Loading question…
Question text

4
Complete the paragraph about databases. Use terms from the list. You may need to use a term
more than once. Some of the terms in the list will not be used.
fields
comments
columns
constant
key
table
primary key
program
records
rows
scripts
database
validation
variable
Database tables consist of … and … .
Rows are … .
… are fields.
Structured query language (SQL) … are used to query data.
A … uniquely identifies a record.
[6]

Advertisement
9
2210/23/O/N/24 · Question 11Oct/Nov 2024Paper 237 marks
Loading question…
Question text

11
Building materials are sold in bags. A new database table called BuildStock has been set up to
store details about the materials for sale. Part of this table is given.
MtNo
Name
InStock
WeightKg
PricePerBag
NumberBags
MT01
Builders sand
Yes
50
4.50
50
MT02
Sharp sand
Yes
25
3.50
21
MT03
Red sand
No
50
2.75
0
MT04
Cement
No
25
6.85
0
MT05
Chippings
Yes
50
35.00
50
MT06
Cobbles
No
75
67.35
0
MT07
Pebbles small
Yes
50
34.50
3
MT08
Pebbles medium
Yes
25
25.50
10
MT12
Pebbles large
Yes
75
62.75
20
MT15
Washed gravel
Yes
50
12.75
12
MT16
Pea gravel
Yes
100
15.95
24
(a) Write the output from this structured query language (SQL) statement.
SELECT MtNo, Name
FROM BuildStock
WHERE WeightKg = 75
ORDER BY PricePerBag;
…
…
… [3]
(b) (i)
Complete this SQL statement to display only the names of all the materials that are out
of stock.
SELECT …
FROM …
WHERE …
[2]
(ii)
Explain how another SQL statement using a different field could be used to display the
same information.
…
…
…
… [2]
ĬÑĊ®Ġ´íÈõÏĪÅĊÝü¸þ×

10
2210/21/M/J/24 · Question 9May/June 2024Paper 216 marks
Loading question…
Question text

A database table called SoftDrinks stores details of the soft drinks sold by a small shop.
9
Field
Example data
Name
Cola
Supplier
Cambridge Beverages
Container
Can
SizeCl
330
NumberInStock
30
ReorderLevel
15
Reordered
Yes
(a) State whether any of the given fields would be suitable as a primary key and give a reason for
your answer.
…
… [1]
(b) Complete the structured query language (SQL) statement to return the number of cans the
shop has in stock.
SELECT … ( … )
FROM …
WHERE … = … ;
[5]

11
2210/22/M/J/24 · Question 10May/June 2024Paper 228 marks
Loading question…
Question text

10 A television subscription service has a new database table named Contract to store details of
their subscribers’ contracts. The table contains these fields:
•
ContractNumber – the contract number, for example CT567
•
Months – the length of the contract in months, for example 6
•
EndDate – the date the contract finishes, for example 30 November 2024
•
News – the news service, yes or no
•
Movie – the movie service, yes or no
•
Sport – the sports service, yes or no
•
Junior – the children’s service, yes or no.
(a) Identify the field that will be the most appropriate primary key for this table.
… [1]
(b) Complete the table to identify the most appropriate data type for these fields in Contract
Field
Data type
ContractNumber
Months
EndDate
Sport
[2]
(c) Explain the purpose of these structured query language (SQL) statements.
Statement 1: SELECT SUM (Months) FROM Contract;
Statement 2: SELECT COUNT (News) FROM Contract WHERE News;
Statement 1 …
…
…
Statement 2 …
…
…
[3]
(d) Complete this SQL statement to find the contract numbers of the subscribers that take both
the news and sports services.
SELECT …
FROM Contract
WHERE … AND … ;
[2]

12
2210/22/O/N/23 · Question 10Oct/Nov 2023Paper 228 marks
Loading question…
Question text

10 A database table called Horses stores details about the horses kept at a horse sanctuary.
Code
Breed
BreedOrigin
Gender
Age
Arrived
H002
Arabian
Saudi Arabia
M
5
28/09/2022
H004
Percheron
France
M
5
30/10/2022
H010
Friesian
Netherlands
M
6
15/11/2022
H011
Fjord
Norway
F
4
17/11/2022
H012
Clydesdale
Scotland
M
10
18/11/2022
H015
Arabian
Saudi Arabia
F
5
15/12/2022
H016
Arabian
Saudi Arabia
F
5
15/12/2022
H017
Clydesdale
Scotland
F
4
16/01/2023
H019
Percheron
France
M
3
16/01/2023
H025
Percheron
France
M
7
16/01/2023
H026
Clydesdale
Scotland
F
9
20/01/2023
H030
Clydesdale
Scotland
M
12
20/01/2023
H032
Fjord
Norway
M
3
24/03/2023
H033
Arabian
Saudi Arabia
F
15
27/04/2023
H034
Clydesdale
Scotland
F
4
14/06/2023
H035
Fjord
Norway
M
7
15/06/2023
H036
Friesian
Netherlands
F
15
20/07/2023
H037
Friesian
Netherlands
M
12
20/07/2023
(a) State the number of records in this database table.
… [1]
(b) Give the name of the field that is most suitable to be the primary key.
State the reason for this choice.
Field …
Reason …
…
[2]
(c) The database only allows the data types:
•
Boolean
•
character
•
date/time
•
integer
•
real
•
text.
Complete the table to show the most appropriate data type for each field.
Each data type must be different.
Field
Data type
Breed
Gender
Age
Arrived
[2]
(d) Complete the structured query language (SQL) to return the code and breed of all the horses
whose breed originated in Scotland.
… Code, Breed,
FROM …
WHERE … = "Scotland";
[3]

13
2210/23/O/N/23 · Question 9Oct/Nov 2023Paper 2311 marks
Loading question…
Question text

9
A sanctuary for pheasants has set up a new database table called PheasantList to store details
of the different species of bird at the sanctuary. Part of this table is given, showing: species,
description, number of birds at the sanctuary, if the birds are breeding or not, and number of
young born this year.
Species
Description
NumberBirds
Breeding
Young
Edwards
blue-black with white tail
5
Yes
0
Japanese green
dark green with pale grey tail
2
Yes
2
Reeves
golden, white and red scaled plumage
4
Yes
1
Crawfords Kalij
glossy blue-black plumage
4
No
0
Crested fireback
blue-black with black tail
3
No
0
True silver
white laced top half and black lower half
7
Yes
1
Siamese fireback
grey plumage with crimson legs and feet
5
No
0
Mikado
iridescent plumage with white striped wings
3
Yes
4
Red junglefowl
many colours
2
Yes
0
Himalayan monal
many colours with metallic green crest
3
Yes
2
White eared
white with ear tufts
5
Yes
3
Brown eared
brown with ear tufts
9
Yes
1
Ring necked
long tail with white ring neck
2
Yes
2
Golden
rainbow coloured
3
Yes
4
(a) State the number of records and fields in this part of the database table.
Records …
Fields …
[2]
(b) (i)
Give the name of a field that could be used for the primary key.
… [1]
(ii)
Explain why the sanctuary might decide not to use the field in (b)(i) as the primary key.
…
… [1]
(iii)
A new field SpeciesID is added to the database table.
This field contains a six-character code, for example Ph0001.
Give a reason why this field would be a better primary key.
…
… [1]
(c) Write the output that would be given by this structured query language (SQL) statement:
SELECT Species, Description
FROM PheasantList
WHERE NumberBirds > 6;
…
… [2]
(d) Complete this SQL statement to display all the species of pheasant where the birds are
breeding and there were no young born this year:
SELECT …
FROM …
WHERE …
… ;
[4]

Advertisement
14
2210/21/M/J/23 · Question 10May/June 2023Paper 218 marks
Loading question…
Question text

10 A database table called TVRange shows the main features and prices of a range of televisions.
TVCode
ScreenSize
Satellite
SmartTV
SoundBar
Price$
TV90SaSmSd
90
YES
YES
YES
9750.00
TV75SaSmSd
75
YES
YES
YES
8500.00
TV75SaSd
75
YES
NO
YES
8000.00
TV65SaSmSd
65
YES
YES
YES
6000.00
TV65SmSd
65
NO
YES
YES
5000.00
TV65SaSd
65
YES
NO
YES
5000.00
TV55SaSmSd
55
YES
YES
YES
4000.00
TV55SaSd
55
YES
NO
YES
3500.00
TV55SmSd
55
NO
YES
YES
3500.00
TV50SaSmSd
50
YES
YES
YES
2500.00
TV50Sa
50
YES
NO
NO
1750.00
TV50Sm
50
NO
YES
NO
1750.00
TV40Sa
40
YES
NO
NO
1200.00
TV40
40
NO
NO
NO
950.00
TV32
32
NO
NO
NO
650.00
(a) Give the name of the field that is most suitable to be the primary key.
State the reason for this choice.
Field …
Reason …
…
[2]
(b) The database uses the data types:
•
text
•
character
•
Boolean
•
integer
•
real
•
date/time.
Complete the table to show the most appropriate data type for each field.
Each data type must be different.
Field
Data type
TVCode
ScreenSize
SmartTV
Price$
[2]
(c) Complete the structured query language (SQL) query to return the television (TV) code,
screen size and price of all Smart TVs in the database table.
SELECT TVCode, … , …
… TVRange
WHERE SmartTV = … ;
[4]

15
2210/22/M/J/23 · Question 10May/June 2023Paper 226 marks
Loading question…
Question text

10 A music streaming service has a new database table named Songs to store details of songs
available for streaming. The table contains the fields:
•
SongNumber – the catalogue number, for example AG123
•
Title – the title of the song
•
Author – the name of the song writer(s)
•
Singer – the name of the singer(s)
•
Genre – the type of music, for example rock
•
Minutes – the length of the song in minutes, for example 3.75
•
Recorded – the date the song was recorded.
(a) Identify the field that will be the most appropriate primary key for this table.
… [1]
(b) Complete the table to identify the most appropriate data type for the fields in Songs
Field
Data type
SongNumber
Title
Recorded
Minutes
[2]
(c) Explain the purpose of the structured query language (SQL) statements.
SUM (Minutes) FROM Songs WHERE Genre = "rock";
COUNT (Title) FROM Songs WHERE Genre = "rock";
…
…
…
…
…
… [3]

Advertisement