Databases and SQL – O Level Computer Science (2210)

21 questions · page 1 of 2 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
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]
ĬÓĊ®Ġ´íÈõÏĪÅĊÞü·þ×

2
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]
ĬÑĊ®Ġ´íÈõÏĪÅĊßù¸þ×

3
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]
ĬÓĊ®Ġ´íÈõÏĪÅĊÞû¸þ×

Advertisement
4
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]

5
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]
ĬÑĊ®Ġ´íÈõÏĪÅĊÝü¸þ×

6
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]

7
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]

8
2210/22/O/N/22 · Question 3Oct/Nov 2022Paper 223 marks
Loading question…
Question text

3
Describe the use of verification on input of data when entering a list of items in stock into a
database. Explain why verification is necessary.
…
…
…
…
…
… [3]

Advertisement
9
2210/22/O/N/22 · Question 7Oct/Nov 2022Paper 228 marks
Loading question…
Question text

7
A school uses a database table, ASSESS, to keep a record of the internal assessments and the
number of candidates for each of the subjects in its curriculum.
SubjectCode
SubjectName
Exams
Practicals
Candidates
COMP
Computer Science
2
1
200
INFO
Information Technology
1
2
200
MATH
Mathematics
3
0
350
PHYS
Physics
2
1
120
CHEM
Chemistry
2
1
120
BIOL
Biology
2
1
200
GEOG
Geography
2
0
200
HIST
History
2
0
250
GEOL
Geology
2
0
80
PHED
Physical Education
1
2
350
FREN
French
2
2
120
ENGL
English
2
2
350
This database only allows the data types:
•
text
•
number
•
currency
•
Boolean.
(a) (i)
State the most appropriate data type for the fields SubjectCode and Exams.
SubjectCode …
Exams …
[1]
(ii)
State one reason why the Candidates field could not be of the Boolean data type.
…
… [1]
(b) Show the output given by the query-by-example grid.
Field:
SubjectName
Practicals
Candidates
Table:
ASSESS
ASSESS
ASSESS
Sort:
Ascending
Show:
3
3
Criteria:
<1
or:
…
…
…
…
…
… [3]
(c) Complete the query-by-example grid to output the subjects with fewer than 150 candidates.
Display only the SubjectCode, SubjectName and Candidates fields in order of the number of
candidates from largest to smallest.
Field:
Table:
Sort:
Show:
Criteria:
or:
[3]
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

10
2210/23/O/N/22 · Question 5Oct/Nov 2022Paper 235 marks
Loading question…
Question text

5
A database table, MUSEUM, is used to keep a record of items in the museum. The table has
these fields:
•
ItemCode – code for each type of item, for example ART0005
•
Description – brief description of each item, for example gold coin
•
InStore – whether the item is in store or not, for example Y
•
Century – century when item made, for example 18
•
Country – country of origin, for example China.
(a) Identify which field you would choose for the primary key.
State a reason for your choice.
Field …
Reason …
…
[2]
(b) Complete the query-by-example grid to display only the description and the country of origin
for those items not in store.
Field:
Table:
Sort:
Show:
Criteria:
or:
[3]
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

11
2210/22/O/N/21 · Question 6Oct/Nov 2021Paper 226 marks
Loading question…
Question text

6
A pet supplier uses the database table, STOCK, to keep records of its products for pets.
The fields are:
Field name
Description
ProductID
code to identify the product
ProductName
name of product
ProductDescription
information about the product
Animal
type of animal the product is for, e.g. cat, bird, horse
ProductType
type of product, e.g. food, toy, medicine
whether the product is in stock or not
InStock
(a) (i)
Identify the field that could have a Boolean data type.
… [1]
(ii)
Identify the field that should be used as the primary key.
… [1]
(b) Complete the query-by-example grid to output the products intended for a cat that are in
stock. Display only the primary key and the name of the products. The output should be
sorted by the primary key.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
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 the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of

12
2210/22/O/N/20 · Question 7Oct/Nov 2020Paper 227 marks
Loading question…
Question text

7
The table AUDIOPARTS stores the part number, description, cost and quantity in stock of the
items sold by a music shop.
PartNum
Description
Cost
Quantity
A01
Compact Amplifier Case
50.00
15
A02
Deluxe Amplifier Case
75.00
1
A03
Amplifier Standard
79.99
48
A04
Amplifier Midrange
149.99
50
A05
Amplifier Megablaster
299.99
48
S01
Tweeter
59.99
10
S02
Midrange Woofer
99.99
0
S03
Subwoofer
139.99
16
S04
Tower Speaker Basic
159.99
25
S05
Tower Speaker Skyscraper
219.99
9
S06
Centre Speaker
149.99
25
S07
Soundbar
89.99
2
S20
Soundbar
129.99
0
S21
Ceiling Surround Speaker
75.00
15
S22
Ceiling Full Range Speaker
100.00
1
S25
Surround Speaker
100.00
60
T19
Speaker Stands (Pair)
75.00
60
(a) State the number of records in the table AUDIOPARTS
… [1]
(b) Identify the field that is most suitable to be a primary key and give a reason for your choice.
Fieldname …
Reason …
…
…
[2]
(c) Complete the query-by-example grid to show the items where the quantity in stock is fewer
than 10. Show all the fields from the database table in descending order of cost.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]

13
2210/23/O/N/20 · Question 5Oct/Nov 2020Paper 238 marks
Loading question…
Question text

5
A marine wildlife rescue centre uses a database table, MARINE, to keep records of its creatures.
Creature
Class
Quantity
Ready for release
Offspring
Manta Ray
Fish
3
Y
N
Short-tailed Albatross
Bird
4
Y
N
Emperor Penguin
Bird
50
Y
Y
Bluefin Tuna
Fish
2
N
N
Manatee
Mammal
4
Y
N
Hawksbill Turtle
Reptile
10
Y
Y
Hammerhead Shark
Fish
3
Y
N
Yellow-eyed Penguin
Bird
4
Y
N
Kemp’s Ridley Sea Turtle
Reptile
1
Y
N
(a) State how many fields and how many records are shown in this table.
Number of fields …
Number of records …
[2]
(b) Show the output that would be given by this query-by-example.
Field: Creature
Class
Ready for release
Table: MARINE
MARINE
MARINE
Sort:
Show:
3
3
Criteria:
="Bird"
or:
…
…
… [2]
(c) Complete the query-by-example grid to display the creatures, in ascending order of quantity,
that have no offspring and are ready for release. Display only the creature field.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
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 the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of

Advertisement
14
2210/22/O/N/19 · Question 7Oct/Nov 2019Paper 226 marks
Loading question…
Question text

7
A database table, SALES, is used to keep a record of items made and sold by a furniture maker.
Item number
Order number
Notes
Amount
Status
CH001
1921
Smith – six dining chairs
6
Delivered
TB003
1921
Smith – large table
1
In progress
CH001
1924
Hue – extra chairs
4
In progress
CH003
1925
For stock
2
Cancelled
BN001
1927
Patel – replacement bench
1
Not started
ST002
1931
Sola – small table
1
Delivered
CH003
1927
Patel – eight dining chairs with arms
8
Not started
TB003
1927
Patel – large table
1
Not started
(a) Explain why the field Item number could not be used as a primary key.
…
… [1]
(b) A query-by-example has been written to display only the order number and item numbers of
any items in progress or not started.
Field:
Item number
Order number
Amount
Status
Table:
SALES
SALES
SALES
SALES
Sort:
Show:
3
3
Criteria:
Not Like "Delivered"
or:
Explain why the query-by-example is incorrect, and write a correct query-by-example.
Explanation …
…
…
…
…
Field:
Table:
Sort:
Show:
Criteria:
or:
[5]
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 the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of

15
2210/23/O/N/19 · Question 7Oct/Nov 2019Paper 238 marks
Loading question…
Question text

7
A teacher has decided to use a database table as her mark book for her Computer Science class,
which she has called MARKBOOK. For each student, the following data will be recorded: first
name, last name, their year 10 test score and their year 11 test score. The class has 32 students.
(a) State the number of fields and records required for this database.
Number of Fields …
Number of Records …
[2]
(b) The data in MARKBOOK is stored under category headings: LastName, FirstName,
Y10TestScore and Y11TestScore.
State, with a reason, whether any of these headings would be suitable as a primary key.
…
…
…
… [2]
(c) Complete the query-by-example grid to only display the first name, last name and year 10
test score of each student who achieved 50 or more in their year 10 test. The output should
be in test score order with the highest marks at the top of the list.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
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 the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of

Advertisement