Databases and SQL – O Level Computer Science (2210)

44 questions · page 2 of 3 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
16
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]

17
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

18
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
19
2210/21/M/J/22 · Question 6May/June 2022Paper 215 marks
Loading question…
Question text

6
A computer game shop records its stock levels in a database table called GAMES. The fields used
in the stock table are shown.
Name
Description
GameID
primary key
GameName
the name of each game
AgeRestriction
the minimum age at which a person is allowed to play each game
GamePrice
the selling price for each game
NumberStock
the quantity of each game currently in stock
whether or not each game is on order from the suppliers
OnOrder
DateLastOrdered
the date the most recent order for each game was placed
GameDescription
a summary of the contents and purpose of each game
(a) State the number of fields that are in the table GAMES.
… [1]
(b) State one important fact that must be true for a field to be a primary key.
…
… [1]
(c) Complete the query-by-example grid to output all the games that have no stock and that are
on order with the supplier. Display only the GameID, GameName and GamePrice fields in
alphabetical order of the name of the game.
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

20
2210/22/M/J/22 · Question 5May/June 2022Paper 225 marks
Loading question…
Question text

5
A database table, NURSE, is used to keep a record of disposable items worn by veterinary nurses.
This is part of the table:
ItemNumber
Description
SingleUse
Uses
StockLevel
ReorderLevel
DIG1
Glove (pair)
Y
1
500
800
DIA1
Apron
Y
1
700
800
DIM5
Hair net
Y
1
650
500
DIA2
Apron
N
5
25
100
DIS4
Suit
N
3
70
50
DIV9
Shoe cover (pair)
Y
1
400
250
(a) Complete this query-by-example grid to display only the item number and the description of
single use items, where the stock level is below the reorder level.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
(b) Give a reason why the field SingleUse is not required in the table NURSE.
…
… [1]
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

21
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

22
2210/21/M/J/21 · Question 6May/June 2021Paper 216 marks
Loading question…
Question text

6
A library uses a database table, GENRE, to keep a record of the number of books it has in each
genre.
ID
GenreName
Total
Available
Loaned
Overdue
ABI
Autobiography
500
250
250
20
BIO
Biography
650
400
250
0
EDU
Education
20200
10000
10200
1250
FAN
Fantasy
1575
500
1075
13
GFI
General Fiction
35253
23520
11733
0
GNF
General Non-Fiction
25200
12020
13180
0
HFI
Historical Fiction
6300
3500
2800
0
HNF
Historical Non-Fiction
8000
1523
6477
0
HUM
Humour
13500
9580
3920
46
MYS
Mystery
26000
13269
12731
0
PFI
Political Fiction
23561
10523
13038
500
PNF
Political Non-Fiction
1823
750
1073
23
REF
Reference
374
374
0
0
ROM
Romance
18269
16800
1469
0
SAT
Satirical
23567
12500
11067
0
SCF
Science Fiction
36025
25000
11025
0
SPO
Sport
45720
32687
13033
3256
THR
Thriller
86000
46859
39141
0
(a) State the reason ID could be used as a primary key in the table GENRE.
…
… [1]
(b) State the number of records in the table GENRE.
…
… [1]
(c) Complete the query-by-example grid to display any genres with overdue books. Only display
the ID, GenreName and Overdue fields in order of the number of books overdue from largest
to smallest.
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

23
2210/22/M/J/21 · Question 6May/June 2021Paper 225 marks
Loading question…
Question text

6
A database table, PLANT, is used to keep a record of plants sold by a nursery. The table has these
fields:
•
NAME – name of plant
•
FLOWER – whether the plant flowers (True) or not (False)
•
POSITION – shade, partial shade or sun
•
SIZE – small, medium or large
•
PRICE – price in $
•
NUMBERSOLD – how many sold
A query-by-example grid has been completed to display only the price, name and number sold of
small plants that do not flower.
NAME
PRICE
NUMBERSOLD SIZE
FLOWER
POSITION
Field:
Table: PLANT
Sort:
Show:
3
3
3
Criteria:
= "shade"
or:
Identify the errors in the query-by-example grid.
…
…
…
…
…
…
Rewrite the corrected query-by-example grid.
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

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

25
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

26
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

27
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

28
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
29
2210/21/M/J/19 · Question 5May/June 2019Paper 219 marks
Loading question…
Question text

5
The table, BEVERAGES, shows the number of calories in 100 ml of a range of popular beverages.
It also shows the availability of these drinks in a can, a small bottle and a large bottle.
BevNo
BevName
Calories
Can
Small Bottle
Large Bottle
Bev01
Cola
40
Yes
Yes
Yes
Bev02
Lime
45
Yes
No
Yes
Bev03
Energy Drink 1
52
Yes
Yes
No
Bev04
Energy Drink 2
43
Yes
No
No
Bev05
Mango
47
Yes
No
Yes
Bev06
Lemon Iced Tea
38
Yes
No
Yes
Bev07
Lemonade
58
Yes
Yes
Yes
Bev08
Orange Juice
46
Yes
Yes
No
Bev12
Apple Juice
50
Yes
Yes
No
Bev15
Chocolate Milk
83
Yes
Yes
No
(a) Give a reason for choosing BevNo as the primary key for this table.
…
… [1]
(b) State the number of records shown in the table BEVERAGES.
… [1]
(c) List the output that would be given by this query-by-example.
Field:
BevNo
BevName
Can
Small Bottle
Large Bottle
Table:
BEVERAGES
BEVERAGES
BEVERAGES
BEVERAGES
BEVERAGES
Sort:
Descending
Show:
ü
ü
Criteria:
= "Yes"
= "Yes"
= "Yes"
or:
…
…
…
… [3]
(d) Complete the query-by-example grid to output a list showing just the names and primary keys
of all the beverages with a calorie count greater than 45. The list should be in alphabetical
order of names.
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

30
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

Advertisement