Databases and SQL – O Level Computer Science (2210)

10 questions

0 / 0Answer a question to start your score.
New quizSaved 0

Quick quiz: 10 random questions from this topic. Answer them all, then open the Summary.

Advertisement
1
2210/22/M/J/19 · Question 6May/June 2019Paper 228 marks
Loading question…
Question text

6
A database table, FLIGHT, is used to keep a record of flights from a small airfield. Planes can
carry passengers, freight or both. Some flights are marked as private and only carry passengers.
Flight number
Plane
Notes
Departure time
Passengers
FN101
Caravan 1
Private passenger flight
08:00
Y
CN101
Caravan 2
Freight only
08:30
N
CN102
Piper 1
Freight only
09:00
N
FN104
Piper 2
Passengers only
09:20
Y
FN105
Piper 1
Freight and passengers
10:00
Y
FN106
Caravan 1
Passengers only
10:30
Y
CN108
Caravan 2
Freight only
08:00
N
CN110
Lear
Private passenger flight
08:00
Y
(a) State the field that could have a Boolean data type.
Field … [1]
(b) A query-by-example has been written to display just the flight numbers of all planes leaving
after 10:00 that only carry passengers.
Field:
Flight number
Passengers
Departure time
Table:
FLIGHT
FLIGHT
FLIGHT
Sort:
Show:
3
Criteria:
= Y
= 10:00
or:
Explain why the query-by-example is incorrect, and write a correct query-by-example.
Explanation …
…
…
…
…
Field:
Table:
Sort:
Show:
Criteria:
or:
[7]
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

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

3
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

Advertisement
4
2210/21/M/J/16 · Question 3May/June 2016Paper 217 marks
Loading question…
Question text

3
A program will be written to store information about members of a swimming club.
The following membership details will be recorded:
•
Name
•
Gender
•
Status:
•
Senior
•
Junior
•
Fee
•
Team member (Yes or No)
(i)
Choose a suitable data type for each of the membership details to be recorded.
Membership details
Data type
Name
Gender
Status
Fee
Team member
[5]
(ii)
The swimming club has 50 members.
State the data structure that would be most suitable to use and give a reason for your
choice.
Data structure …
Reason …
… [2]

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

6
2210/21/M/J/17 · Question 7May/June 2017Paper 219 marks
Loading question…
Question text

7
A television (TV) store has a database table, TVSTOCK, for its new range of televisions. The table
stores the screen size of each TV, whether it will show 3D, whether the screen is curved or flat,
if the internet is available on the TV, if it has a built-in hard disk drive and the price. Part of the
database table is shown below.
TVID
ScreenSize
3D
CurvedFlat
Internet
HDD
Price
TV80CVINT
80
YES
CV
YES
YES
$7,000.00
TV65CVINT
65
YES
CV
YES
YES
$5,000.00
TV60CVINT
60
YES
CV
YES
YES
$4,500.00
TV60FTINT
60
YES
FT
YES
YES
$4,000.00
TV55CVINT
55
YES
CV
YES
NO
$3,000.00
TV55FTINT
55
YES
FT
YES
NO
$3,500.00
TV55FTNIN
55
YES
FT
NO
NO
$3,000.00
TV50CVINT
50
YES
CV
YES
NO
$2,500.00
TV50FTINT
50
YES
FT
YES
NO
$2,000.00
TV50FTNIN
50
YES
FT
NO
NO
$1,750.00
TV42FTINT
42
YES
FT
YES
NO
$1,500.00
TV37FTINT
37
NO
FT
YES
NO
$1,200.00
TV20FTNIN
20
NO
FT
NO
NO
$800.00
TV15FTNIN
15
NO
FT
NO
NO
$400.00
(a) State the type of the field TVID and give a reason for your choice.
…
…
… [1]
(b) Complete the table with the most appropriate data type for each field.
Field name
Data type
ScreenSize
3D
CurvedFlat
Internet
HDD
Price
[3]
(c) Use the query-by-example grid below to provide a list of all of the curved screen TVs that
have a built-in hard disk drive. Make sure the list only displays the TVID, the price and the
screen size in ascending order of price.
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 International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local

7
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

8
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

Advertisement
9
2210/21/M/J/20 · Question 6May/June 2020Paper 217 marks
Loading question…
Question text

6
A garden centre sells garden tools and stores details of these in a database table named TOOLS.
Code is the primary key in the TOOLS table.
Code
Description
Price ($)
Quantity_Stock
Quantity_Ordered
GFLG
Garden Fork
50.00
1
50
GSLG
Garden Spade
50.00
11
0
GHLG
Garden Hoe
45.00
8
0
HFSM
Hand Fork
9.99
42
0
HSSM
Hand Spade
9.99
40
0
HWSM
Hand Weeder
9.99
11
0
HS20
Hose (20 metres)
45.00
10
0
HS35
Hose (35 metres)
60.00
2
0
HS50
Hose (50 metres)
75.00
20
60
YBLG
Yard Brush
24.99
100
0
LMHD
Lawn Mower
99.99
5
0
LMBT
Lawn Mower (Battery)
249.99
7
0
LMPT
Lawn Mower (Petrol)
349.99
10
25
TRBT
Edge Trimmer (Battery)
79.99
15
0
TRPT
Edge Trimmer (Petrol)
59.99
20
0
SHSM
Shears
40.00
40
0
HCSM
Hedge Clippers
40.00
45
0
(a) State the purpose of the primary key in the TOOLS table.
…
…
… [1]
(b) List the output from the data shown in the table TOOLS that would be given by this query-by-
example.
Field:
Code
Description
Price ($)
Quantity_Stock
Quantity_Ordered
Table:
TOOLS
TOOLS
TOOLS
TOOLS
TOOLS
Sort:
Descending
Show:
ü
ü
ü
Criteria:
>40
>0
>0
or:
…
…
…
…
…
… [3]
(c) Complete the query-by-example grid to output the tools where the quantity in stock is below
25. Only show the Code, Description and Quantity_Stock fields in ascending order of Code.
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 the Cambridge Assessment Group. Cambridge Assessment is the brand name of the University of

10
2210/22/O/N/16 · Question 5Oct/Nov 2016Paper 2212 marks
Loading question…
Question text

5
A database, PLAYPRODUCTION, was set up to show the performance dates, prices and number
of seats available at a theatre specialising in Shakespeare productions.
Number
Number
Performance
Price Stalls
Price Circle
Play
Seats
Seats
Date
Seats $
Seats $
Stalls
Circle
As You Like It
01/07/2016
120
90
20.00
30.00
As You Like It
02/07/2016
85
45
30.00
40.00
As You Like It
09/07/2016
31
4
30.00
40.00
Macbeth
14/07/2016
101
56
25.00
35.00
Macbeth
15/07/2016
50
34
25.00
35.00
Macbeth
16/07/2016
12
5
35.00
50.00
Julius Caesar
22/07/2016
67
111
20.00
20.00
Julius Caesar
23/07/2016
21
24
15.00
15.00
A Comedy of Errors
30/07/2016
45
36
35.00
45.00
(a) Give the number of fields that are in each record.
… [1]
(b) State the data type you would choose for each of the following fields.
Play …
Number Seats Stalls …
Price Stalls Seats $ … [3]
(c) The query-by-example grid below selects all the productions with more than 100 seats left in
either the stalls or the circle.
Field: Play
Performance Date
Number Seats Stalls
Number Seats Circle
Table: PLAYPRODUCTION
PLAYPRODUCTION
PLAYPRODUCTION
PLAYPRODUCTION
Sort: Ascending


Show:
Criteria:
> 100
or:
> 100
Show what would be output from the query-by-example.
…
…
… [3]
(d) Complete the query-by-example grid below to select all the productions with at least six seats
left in the circle and show the Play, Performance Date and Price Circle Seats $ in Performance
Date order.
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 reasonable
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 International
Examinations Copyright Acknowledgements Booklet. This is produced for each series of examinations and is freely available to download at www.cie.org.uk after
the live examination series.
Cambridge International Examinations is part of the Cambridge Assessment Group. Cambridge Assessment is the brand name of University of Cambridge Local

Advertisement