0% found this document useful (0 votes)
13 views22 pages

Chapter 9

Uploaded by

xainab800
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views22 pages

Chapter 9

Uploaded by

xainab800
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

3$*(

&+$37(5

3$*(
3$*(

12

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  Yes Yes Yes
Bev02 Lime  Yes No Yes
Bev03 Energy Drink 1 52 Yes Yes No
%HY Energy Drink 2  Yes No No
Bev05 Mango  Yes No Yes
Bev06 Lemon Iced Tea 38 Yes No Yes
%HY Lemonade 58 Yes Yes Yes
Bev08 Orange Juice  Yes Yes No
Bev12 Apple Juice 50 Yes Yes No
Bev15 Chocolate Milk 83 Yes Yes No

(a) Give a reason for choosing


choosi
sing
ng
g BevNo as the primary key for this table.

............................
....
. ..
....
....................................................................................................................
...................................................................................................................................................

...
............
.. .........................................................
...................
. ..................
.....................................................
............................................................................................................................................. .......... [1]

(b) Stat
atte th
State the
e number
numb
nu mber
mberr of records
record
ds shown in the table BEVERAGES.

.......
...
. ......................................................................................................................................... [1]
.............................................................................................................................................

© UCLES 2019 2210/21/M/J/19


3$*(

12

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

© UCLES 2019 2210/22/M/J/19


3$*(

13

(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: 

Criteria: =Y = 10:00
or:

Explain why the query-by-example is incorrect, and write a correct query-by-example.

Explanation ...............................................................................................................................

...................................................................................................................................................

...........................................
.........................................................................................................
...................................................................................................................................................

....................................
..................................................................................................................
....
...................................................................................................................................................

.........................
........
............................
. ..
....
. ....................
... ............
. ..
....
. ............................
................
. .........
................................................................................................................................................... ...............

Field:
Table:
So
ort
rt::
Sort:

Show:

Criteria:
or:
[7]

© UCLES 2019 2210/22/M/J/19


3$*(

12

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 numberr could not be used as a primary key.

...................................................................................................................................................

.........................................
........................................................................................................ [1]
.............................................................................................................................................

© UCLES 2019 2210/22/O/N/19


3$*(

12

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 que ue


ery
y-b
by-exam
a ple grid
am
query-by-example g id to onlyy display
gr displ
p ayy the first name,, last name and year year 10
test score
sco
core
co re of of each
each student
ea stu
tudent who
who achieved
ach
chieve
veed 500 or
or more
mooree in
n their
th
hei
eirr year
yeear 10
0 test.
te
estt. The
Th
he output
outp
put should
be iin
n te
test
sstt sscore
core
co re
eo rder with th
rd
order tthe
eh igh
gheest ma
est
highest m r s at tthe
rk
marks he
e ttop
op o
off the
th
he list
st..
list.

Field:
Fie
eld:
eld:
d:

Table:
Tabl
ble:
ble
e:

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 effort has been made by the publisher (UCLES) to trace copyright holders, but if any items requiring clearance have unwittingly been included, the
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
Cambridge Local Examinations Syndicate (UCLES), which itself is a department of the University of Cambridge.

© UCLES 2019 2210/23/O/N/19


3$*(

12

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)
Batt
Bat erry)
tt 249.99 7 0
LMPT Mower
Lawn Mow
ow er (Petrol)
wer (Petroll) 349.99
349
4 .9
99 10 25
TRBT
T Edge
E ge
Edg Trimmer
Trimmer (Battery)
r mm (Battter
ery) 79.99
79.9
79 99 15 0
TRPT Edge
Edge Trimmer
rimmer (Petrol)
Tri (Petrrol) 59.99 20 0
SHSM
SM
M Shears
Sh
Shea
hea
ears
rs
s 40.00 40 0
HCSM
HCSM
M Hedge
Hedg
Hedge
dge Clippers
Clippers 40.00 45 0

(a) State the purpose of the primary


riimary key in the TOOLS table.
pri

...................................................................................................................................................
.............................................
.......................................................................................................

...................................................................................................................................................

............................................................................................................................................. [1]

© UCLES 2020 2210/21/M/J/20


3$*(

13

6 A database table, JUICE, is used to keep a record of cartons of fresh fruit juice available for sale.

Juice code Fruit 1 Fruit 2 Size Volume (ml) Stock level


LMO10 Mango Orange Large 1000 18
MOO05 Orange Orange Medium 500 8
SAM02 Apple Mango Small 200 25
SAA02 Apple Apple Small 200 50
SPP02 Pineapple Pineapple Small 200 10
MMM05 Mango Mango Medium 500 12
LMM10 Mango Mango Large 1000 5
MGG05 Guava Guava Medium 500 5
SMO02 Mango Orange Small 200 7
MOP05 Orange Pineapple Medium 500 12
LAA10 Apple Apple Large 1000 32
SGO02 Guava Orange Small 200 10
LPP10 Pineapple Pineapple Large 1000 3
LOO10 Orange Orange Large 1000 25
SOO02 Orange Orange Small 200 40

(a) Identify
fy
y a ssuitable
uita
ui ta
able
e fi
ffield
iel
eld to u
el se ass th
use the
e pr
rim
imaryy ke
primary key.
y S ta
ate a rreason
State ea
aso
on fo
for yo
you
ur cho
your oic
ice.
e
choice.

d ..
Field ..............
.........................
. .......................................................................................................
..........................................................................................................................................

Reas
Re ason
as
Reasonon
n .......................................................................................................................................
. ....
.. ..........
. ...........................................................................................................................

.....
...
.......
.............................................................................................................................................
...................................................................................................................................................
[2]

(b) Complete the query-by-example


query-by-exam
a ple grid to display only the stock level and size of all cartons
am
containing only apple juice.

Field:
Table:
Sort:
Show:
Criteria:
or:
[4]

© UCLES 2020 2210/22/M/J/20


3$*(

11

11 A database table, 2018MOV, is used to keep a record of movie details.

CatNo Title Genre1 Genre2 Blu-ray DVD Streaming


18m01 Power Rangers Adventure Fantasy Yes No Yes
18m02 Baywatch Comedy Drama Yes No Yes
18m03 Table 19 Comedy Drama Yes Yes No
18m04 Wonder Woman Action Fantasy Yes No Yes
18m05 Justice League Action Fantasy Yes Yes Yes
18m06 Twilight Thriller Action Yes Yes No
18m07 Ant Man Action Fantasy No Yes No
18m08 Venice Beach Action History No Yes No
18m12 Fast Five Action Thriller No Yes No
18m15 King Kong Adventure Fantasy No Yes No
18m16 Transformers: The Last Knight Action Sci-Fi Yes Yes Yes
18m17 The Dark Tower Fantasy Sci-Fi Yes Yes No
18m19 Beauty and the Beast Fantasy Romance Yes Yes Yes
18m21 The Mummy Action Fantasy No No Yes
18m22 Star Wars: Ep
pis
isod
sod
ode
EpisodeeV III
VIII S
Sc i-Fi
Fi
Sci-Fi Ac
A tiion
Action Ye
Y
Yess No
No Yess
Yes
18m23 Gu
ua
ard
rdia
dia
ian
ans of
Guardians of the
t e Galaxy
th Galaxy Actitiion
Ac
Action n Sci--Fi
Fi
Sci-Fi Yes
Yes Yes
es
Yes Yes
Yes
18m26 Tho
ho
or
Thor Action Sci-Fi No Yes Yes
7
18m27 Tw
wiililigh
Twilightght
ht Fant
Fantas
ntassy
Fantasy Sc -F
Sci Fi
Sci-Fi No
No No
No Yes
e
Yes
18m3
m3
30
18m30 Ben
enea
enea
e th
Beneath Action Fantasy Yes No No
18m31 Despicable Me Animation Action Yes Yes No

(a) State the number of recordss in the database table.

.............................................................................................................................................. [1]

(b) (i) Give the name of the field that would be used for the primary key.

...................................................................................................................................... [1]

(ii) State the reason for choosing this field for the primary key.

...........................................................................................................................................

...................................................................................................................................... [1]

© UCLES 2020 2210/02/SP/23 [Turn over


3$*(

12

(c) Complete the table to identify the most appropriate data type for each field based on the data
shown in the database table, 2018MOV.

Field Data type

CatNo

Title

Genre1

Streaming

[2]

Complete
(d) Compple e the
ete he structured
the struc
ruc
uctuured query
tu uery language
qu lang ge (SQL)
nguage (SQL to return
QL) returrn the
etu the category
categorry number
ateg
ateg er and
number d titlee for all
tittle
Comedy
Co
ome movies.
medyy m ovie
ie
es.
s

SELECT
LECT CatNo,
SEL
LE Cat
atNo
atNo, Title
No,

..................................................
.......
................................................ 20
2018MOV
2018
8MOV

..................................................;
WHERE Genre1 = ...........
........................................;
[2]

© UCLES 2020 2210/02/SP/23


3$*(
3$*(

&+$37(5

0$5.,1*
6&+(0(
3$*(
3$*(

2210/21 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

5(a) Each data value is unique 1

5(b) 10 records 1

5(c) Bev07 Lemonade 3


Bev01 Cola

1 mark for each correct content


1 mark for each correct format
1 mark for correct order

5(d) 4
Field: BevNo BevName Calories

Table: BEVERAGES BEVERAGES BEVERAGES

Sort: Ascending

Show: ; ; † † † †
Criteria: >45

or:

1mma
mark
ark
r for
forr correct
cor
orrrect Field
ld
d roww
1 ma
mark
rk for
for Table
Table and Sort
Sort rows
1 ma
m rk ffor
mark o ccorrect
or o rect Sho
or ow row
Show
1 mar
maark
rk ffor
mark o ccorrect
or orrect Crite
te
eria rows
Criteria

© UCLES 2019 Page 9 of 9


3$*(

2210/22 Cambridge O Level – Mark Scheme May/June 2019


PUBLISHED

Question Answer Marks

6(a) Passengers 1

6(b) Explanation 7
Three from:
x Flight number not displayed
x Passengers displayed when should not be
x Departure time = not >
x "Freight and passengers" flight not excluded

Revised QBE – answers shown are examples only


1 mark per bullet
x correct field and table names (either 3 or 4 columns) must include
Notes, Flight number and Departure time
x correct show
x correct time criteria for the candidate’s QBE grid
x use of criteria to select planes with passengers only

number
Field: Flight numb
ber
e Passengers Departure time Notes

Table: FLIGH
FLIGHT
HT FLIGHT FLIGHT FLIGHT

Sort:

Show:
Sh
how
ow:: ; † † †
=Y >10:00 <> "Freight and
Criteria:
C
Crit
Crritter
eria:
eri
passengers"

or:
o r:
OR
Field: Flight numb
m er
number Departure time Notes

Table: FLIGHT
FLIGH
HT FLIGHT FLIGHT

Sort:

Show: ; † †
Criteria: >10:00 = "Passengers only"

>10:00 ="Private passenger


or:
flight"

© UCLES 2019 Page 9 of 9


3$*(

2210/22 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Questio Answer Mark


n s

6 Constants 6
Two from:
x The value cannot be changed accidentally «
x « during the execution of the program
x Value only needs to be changed once if circumstances change/during the
initialisation process

Variables
Two from:
x Stores a value that can change «
x « during the execution of the program
x Can use a variable without knowing its value

Arrays
Two from:
x A list of items of the same data type «
x « stored under a single name
x To reduce the num
number
mber of variables used
x Any item can be foundund using an index number to show its place in the list
fou

Questio Answer
A
An sw
wer
e Mark
Mark
M
n s

7(a) x N umbe
um be
b
Number er is repeated/not
repeate
ed/not unique 1

7(b)
b)) x IItem
tem number
tem
te numb
nu displayed/Amount
mber not dis
mb splayed/Amount column not required 5
x NNot
ot Like
Likke ‘Delivered’’ will
will also show cancelled items

Field: Item numberr Order number Status

Table: SALES SALES SALES

Sort:

Show:
; ; † †
Criteria: Like "Not
started"

or: Like "In


progress"

x Correct Item number column


x Correct Order number column and any additional column not shown
x Correct status column

© UCLES 2019 Page 7 of 7


3$*(

2210/23 Cambridge O Level – Mark Scheme October/November


PUBLISHED 2019

Question Answer Marks

7(a)  Number of Fields: 4 2


 Number of Records: 32

7(b)  No field is suitable as a primary key « 2


 « because none of the data would be unique // duplicates could occur

7(c) 4
Field: FirstName LastName Y10TestScore

Table: MARKBOOK MARKBOOK MARKBOOK

Sort: Descending

Show:
; ; ; †
Criteria: >=50

or:

One mark for each compl


completely
p etely correct column down to and including ‘Show’ row
(maximum three mar arrks
marks)ks)
One mark for corr
rrrect
ect se
correct sear
arch criteria rows
search

© UCLES 2019 Page 8 of 8


2210/21 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

6(a) To uniquely identify a product (in TOOLS) 1

6(b) HS50 Hose (50 metres) 60 3


GFLG Garden Fork 50
LMPT Lawn Mower (Petrol) 25

One mark for correct data


One mark for correct format
One mark for data in correct order

6(c) 3
Field: Code Description
Des
escr
crip
cr ipti
ip tion
ti on Quantity_Stock
Qua
uant
ntit
nt ityy_St
it y_St
Stoc
occk

Table: TOOLS TOOLS TOOLS


TOOL
OLS
OLS

Sort: Ascending

Show: ; ; ; † †
3$*(

Criteria: <25
5

or:

One mark for each completely correct column (max three)

© UCLES 2020 Page 10 of 10


2210/22 Cambridge O Level – Mark Scheme May/June 2020
PUBLISHED
Question Answer Marks

5 One mark for explanation of dimension 3


One mark for explanation of index
One mark for inclusion of an example

The dimension is the number of indexes required to oa ccces


cces
ess an e
access leme
le m nt.
element.
The index is the position of the element in an array
For example A[25] is the 25th element of a one-dimen ensi
s on
si onal
one-dimensional a a
al rray
rr
ray
a .
array.

Question Answer Marks

6(a) One mark for field and one mark for reas
reason
asson 2
Field Juice code
Reason only unique identifier

6(b) 4
Field: Fruit 1 Fruit 2 Size Stock level

Table: JUICE JUICE JUICE JUICE


3$*(

Sort:

Show: † † ; ;

Criteria: ="Apple" ="Apple"

or:

One mark for each correct column

© UCLES 2020 Page 8 of 8


2210/02 Cambridge O Level – Mark Scheme For examination
SPECIMEN from 2023

Question Answer Marks


9 Any three from: 3
x data
data is not lost when the computer is switched off /// da
d ta is stored permanently
x e sed
eu
data can be used by more than one program orr rreused se
ed wh
whenenn a program is run again
x data can be backed up or archived
x data can be transported from one place / systemm to a nother
no er.
another.r

Question An
nsw
swer
e
Answer Marks
10 C 1

Question Answer Marks


11(a) 20 1
11(b)(i) CatNo 1
11(b)(ii) it is a unique identifier 1
11(c) Two marks for four correct answers. 2
One mark for two or three correct answers.
3$*(

Field Data type


CatNo Text
Title Text
Genre1 Text
Streaming Boolean / Text

11(d) FROM 2
"Comedy"

© UCLES 2020 Page 9 of 16


3$*(

You might also like