Databases and SQL – O Level Computer Science (2210)

44 questions · page 3 of 3

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
31
2210/22/O/N/18 · Question 6Oct/Nov 2018Paper 227 marks
Loading question…
Question text

6
A database table, PORTRAIT, is used to keep a record of the portraits available from a photographic
studio. Each portrait has a unique reference number PICnnn, where n is a single digit, for example
PIC123. The studio keeps a record of the size (for example 20 × 15), the type (black and white or
colour), and the price in dollars.
(a) Complete the table to show the most appropriate data type for each of the fields.
Field
Data type
Reference Number
Size
Type
Price in $
[4]
(b) The results from the query-by-example grid should show the reference number, price, type
and size of all portraits under $50. Identify the three errors in the query-by-example grid.
Field:
Reference No
Price in $
Type
Size
Table:
PORTRAIT
PORTRAIT
PORTRAIT
PORTRAIT
Sort:
Show:



Criteria:
>50.00
or:
Error 1 …
…
Error 2 …
…
Error 3 …
…
[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 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

32
2210/23/O/N/18 · Question 6Oct/Nov 2018Paper 2313 marks
Loading question…
Question text

6
An online fruit tree specialist sells fruit trees in various sizes. A database table, TREETAB, shows
the tree type and, for each size, the price and whether they are in stock.
Tree Type
Size1
Size1 In
Size2
Size2 In
Size3
Size3 In
Apple
10.95
Yes
14.95
Yes
29.95
Yes
Apple
12.95
Yes
14.95
Yes
29.95
Yes
Cherry
24.95
No
34.95
No
59.95
Yes
Fig
19.95
Yes
29.95
No
49.95
Yes
Guava
19.95
No
29.95
No
59.95
No
Nectarine
8.50
Yes
11.95
Yes
19.95
Yes
Olive
19.95
No
39.95
Yes
59.95
Yes
Peach
9.25
No
11.95
Yes
19.95
Yes
Pear
10.95
Yes
14.95
Yes
29.95
Yes
Plum
8.95
Yes
11.95
Yes
19.95
Yes
Pomegranate
12.95
No
18.95
Yes
34.95
No
Quince
34.95
Yes
44.95
Yes
84.95
No
(a) State whether any of the fields shown would be suitable as a primary key.
…
Explain your answer …
…
…
[2]
(b) Complete the table to show the most appropriate data type for each of the fields based on the
data shown in the table at the start of question 6.
Field
Data type
Tree Type
Size3
Size2 In
[3]
(c) Show the output that would be given by this query-by-example.
Field: Tree Type
Size1
Size1 In
Table: TREETAB
TREETAB
TREETAB
Sort:
Descending
Show:



Criteria:
<10.00
or:
…
…
…
… [4]
(d) Using the following query-by-example grid, write a query to identify all types of the fruit trees
that are out of stock for all three sizes. Make sure the type of the tree and the various ‘in
stock’ fields are shown. The trees should be listed in alphabetical order by type.
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 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

33
2210/21/M/J/18 · Question 6May/June 2018Paper 218 marks
Loading question…
Question text

6
A database table, PERFORMANCE, is used to keep a record of the performances at a local
theatre.
Show Number
Type
Title
Date
Sold Out
SN091
Comedy
An Evening at Home
01 Sept
Yes
SN102
Drama
Old Places
02 Oct
No
SN113
Jazz
Acoustic Evening
03 Nov
No
SN124
Classical
Mozart Evening
04 Dec
Yes
SN021
Classical
Bach Favourites
01 Feb
Yes
SN032
Jazz
30 Years of Jazz
02 Mar
Yes
SN043
Comedy
Street Night
03 Apr
No
SN054
Comedy
Hoot
04 May
No
(a) State the number of fields and records in the table.
Fields …
Records …
[2]
(b) Give two validation checks that could be performed on the Show Number field.
Validation check 1 …
…
Validation check 2 …
…
[2]
(c) Using the query-by-example grid, write a query to identify jazz performances that are not sold
out. Only display the date and the title.
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 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
34
2210/22/M/J/18 · Question 5May/June 2018Paper 223 marks
Loading question…
Question text

5
A program checks that the weight of a basket of fruit is over 1.00 kilograms and under
1.10 kilograms. Weights are recorded to an accuracy of two decimal places and any weight not in
this form has already been rejected.
Give three weights as test data and for each weight state a reason for choosing it. All your reasons
must be different.
Weight 1 …
Reason …
…
Weight 2 …
Reason …
…
Weight 3 …
Reason …
…
[3]

35
2210/22/M/J/18 · Question 6May/June 2018Paper 227 marks
Loading question…
Question text

6
A database table, TREES, is used to keep a record of the trees in a park. Each tree is given a
unique number and is examined to see if it is at risk of dying. There are over 900 trees; part of the
database table is shown.
Tree Number
Type
Map Position
Age in Years
At Risk
TN091
Acacia
A7
250
Y
TN172
Olive
C5
110
N
TN913
Cedar
B9
8
N
TN824
Banyan
A3
50
Y
TN021
Pine
D5
560
Y
TN532
Teak
C8
76
Y
TN043
Yew
B1
340
N
TN354
Spruce
D4
65
N
TN731
Elm
B10
22
Y
TN869
Oak
C9
13
N
TN954
Pine
E11
3
N
(a) State the number of fields in the table.
… [1]
(b) The tree numbering system uses TN followed by three digits. The numbering system will not
work if there are over 1000 trees.
Describe, with the aid of an example, how you could change the tree numbering system to
allow for over 1000 trees. Existing tree numbers must not be changed.
…
…
…
… [2]
(c) Using the query-by-example grid, write a query to identify at risk trees over 100 years old.
Display only the type and the position on the map.
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 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

36
2210/22/O/N/17 · Question 6Oct/Nov 2017Paper 2210 marks
Loading question…
Question text

6
A database table, TRAIN, is to be set up for a railway company to keep a record of the engines
available for use. Each engine has a unique number made up of 5 digits, nnnnn. The engines
are classified as freight (F) or passenger (P) together with a power classification that is a whole
number between 0 and 9, for example F8. The railway company keeps a record of the date of the
last service for each engine.
(a) Identify the three fields required for the database. Give each field a suitable name and data
type. Provide a sample of data that you could expect to see in the field.
Field 1 Name …
Data type …
Data sample …
Field 2 Name …
Data type …
Data sample …
Field 3 Name …
Data type …
Data sample … [6]
(b) State the field that you should choose as the primary key.
… [1]
(c) Using the query-by-example grid below, write a query to identify all passenger engines that
have not been serviced in the past 12 months. Only display the engine numbers.
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 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

37
2210/23/O/N/17 · Question 6Oct/Nov 2017Paper 236 marks
Loading question…
Question text

6
A wildlife park has a database table, called LIVESTOCK, to classify and record its animal species.
Part of the database table is shown.
Species
Classification
Diet
Legs
Giraffe
Mammal
Herbivore
4
Elephant
Mammal
Herbivore
4
Crocodile
Reptile
Carnivore
4
Ostrich
Bird
Omnivore
2
Gorilla
Mammal
Herbivore
2
Bear
Mammal
Omnivore
4
Rhinoceros
Mammal
Herbivore
4
Hippopotamus
Mammal
Herbivore
4
Flamingo
Bird
Omnivore
2
Lion
Mammal
Carnivore
4
Turtle
Reptile
Omnivore
4
Penguin
Bird
Carnivore
2
(a) Suggest another appropriate field that could be added to this database by stating its name
and data type. State its purpose and give an example of the data it could contain.
Field name …
Data Type …
Purpose …
…
Example of data …
[2]
(b) Use the query-by-example grid below to provide a list of all four legged mammals that are
herbivores, sorted alphabetically by species, with only the species displayed.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]

38
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

Advertisement
39
2210/22/M/J/17 · Question 5May/June 2017Paper 2212 marks
Loading question…
Question text

5
A database table, SHEEP, is used to keep a record of the sheep on a farm. Each sheep has a
unique ear tag, EARnnnn; n is a single digit. The farmer keeps a record of the date of birth, the
gender and the current weight of each sheep in kilograms.
(a) Identify the four fields required for the database. Give each field a suitable name and data
type. Provide a sample of data that you could expect to see in the field.
Field 1 name …
Data type …
Data sample …
Field 2 name …
Data type …
Data sample …
Field 3 name …
Data type …
Data sample …
Field 4 name …
Data type …
Data sample …
[8]
(b) State the field that you would choose as the primary key.
… [1]
(c) Using the query-by-example grid below, write a query to identify the ear tags of all male
sheep weighing over 10 kilograms. Only display the ear tags.
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 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

40
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

41
2210/23/O/N/16 · Question 6Oct/Nov 2016Paper 238 marks
Loading question…
Question text

6
A database, THEATRETOURS, was set up to show the tour dates, towns, number of seats and
prices in local currency for a Shakespeare play.
Town
Tour Date
Number of Seats
Price Local Currency
Wigan
18/08/2016
120
15.00
Dumfries
20/08/2016
160
12.50
Turin
25/08/2016
200
17.00
Macon
27/08/2016
75
18.00
Bordeaux
29/08/2016
170
20.00
Algiers
01/09/2016
125
1350.00
Windhoek
05/09/2016
65
90.00
Windhoek
06/09/2016
65
90.00
Port Elizabeth
10/09/2016
200
110.00
(a) Explain why none of the fields in the database can be used as a primary key.
…
…
… [2]
(b) State a field that could be added as a primary key.
…
Give a reason for choosing this field.
…
… [2]
(c) Use the query-by-example grid below to provide a list of tour dates and seat prices in
alphabetical order of town.
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 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

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

43
2210/21/M/J/16 · Question 6May/June 2016Paper 219 marks
Loading question…
Question text

6
A database, STAFFPHONE, was set up to show the telephone extension numbers for members of
staff working in a department store.
Name
Department
Extension number
Jane Smith
Toys
129
Sue Wong
Books
124
David Chow
Toys
129
Amy Tang
Household
123
Joe Higgs
Books
124
Jane Smith
Shoes
125
Adel Abur
Shoes
125
Peter Patel
Toys
129
(a) Explain why none of the fields in the database can be used as a primary key.
…
…
… [2]
(b) State a field that could be added as a primary key.
…
Give a reason for choosing this field.
…
… [2]
(c) Use the query-by-example grid below to provide a list of all members of staff, in alphabetical
order, grouped by department.
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
44
2210/22/M/J/16 · Question 7May/June 2016Paper 2213 marks
Loading question…
Question text

7
A database, SOFASELECT, was set up to show the prices of suites, sofas and chairs for sale from
an online furniture warehouse. Part of the database is shown below.
Brochure
Number
Number
Description
Material
Colour
Price in $
Number
of Seats
of Pieces
Sofa
SF17
2
1
Leather
Red
950
Sofa
SF19
3
1
Vinyl
Black
1,000
Suite
SU10
4
3
Velvet
Green
1,500
Suite
SU23
5
3
Leather
Brown
950
Recliner chair
RC01
1
1
Leather
Cream
600
Chair
CH16
1
1
Vinyl
Red
250
Recliner sofa
RS23
4
1
Leather
Cream
1,200
Chair
CH10
1
1
Velvet
Red
175
(a) How many fields are in each record?
… [1]
(b) State which field you would choose for the primary key.
…
Give a reason for choosing this field.
…
… [2]
(c) State the data type you would choose for each of the following fields.
Number of Seats …
Price in $ … [2]
(d) The query-by-example grid below selects all the furniture in cream leather.
Field: Description
Material
Colour
Price in $
Brochure Number
Table: SOFASELECT
SOFASELECT
SOFASELECT
SOFASELECT
SOFASELECT
Sort:
Descending



Show:
Criteria:
= ‘Leather’
= ‘Cream’
or:
Show the output from the query-by-example.
…
… [3]
(e) Complete the query-by-example grid below to select and show the brochure number, material,
colour and price of all the furniture with 3 or more seats.
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