Nesrine Databases QP
Nesrine Databases QP
Time allowed: 20
Score: /10
Percentage: /100
Page 1 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
1/11
Combined By NESRINE
Question 1a
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 Yes
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: Episode VIII Sci-Fi Action Yes No Yes
18m23 Guardians of the Galaxy Action Sci-Fi Yes Yes Yes
18m26 Thor Action Sci-Fi No Yes Yes
18m27 Twilight Fantasy Sci-Fi No No Yes
18m30 Beneath Action Fantasy Yes No No
18m31 Despicable Me Animation Action Yes Yes No
a)
State the number of records in the database table.
[1]
[1 mark]
Question 1b
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]
[2 marks]
Page 2 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
2/11
Combined By NESRINE
Question 1c
c)
Complete the table to identify the most appropriate data type for each field based on the data shown in the database table,
2018MOV.
CatNo
Title
Genre1
Streaming
[2]
[2 marks]
Page 3 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
3/11
Combined By NESRINE
Question 2
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
TN371 Elm B10 22 Y
TN869 Oak C9 13 N
TN954 Pine E11 3 N
[1]
[1 mark]
Page 4 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
4/11
Combined By NESRINE
Question 3a
A database was set up to show the properties of certain chemical elements. Part of the database is shown below.
Name of Element Atomic Atomic Melting Boiling State at
element symbol number weight point (C) point (C) room temp
oxygen O 8 16 –218 –183 gas
iron Fe 26 56 1538 2861 solid
mercury Hg 80 201 –38 356 liquid
bromine Br 35 80 –7 59 liquid
osmium Os 76 190 3033 5012 solid
caesium Cs 55 133 28 671 solid
gallium Ga 31 70 30 2204 solid
argon Ar 18 40 –189 –186 gas
silver Ag 47 108 961 2162 solid
a)
Question 3b
b)
Which field would be best suited as primary key?
[1]
[1 mark]
Page 5 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
5/11
Combined By NESRINE
Question 4a
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
SPO Thriller 86000 46859 39141 0
a)
State the reason ID could be used as a primary key in the table GENRE.
[1]
[1 mark]
Question 4b
b)
State the number of records in the table GENRE.
[1]
[1 mark]
Page 6 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
6/11
Combined By NESRINE
9.2 SQL
Question Paper
Time allowed: 20
Score: /12
Percentage: /100
Page 1 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
7/11
Combined By NESRINE
Question 1
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 Yes
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: Episode VIII Sci-Fi Action Yes No Yes
18m23 Guardians of the Galaxy Action Sci-Fi Yes Yes Yes
18m26 Thor Action Sci-Fi No Yes Yes
18m27 Twilight Fantasy Sci-Fi No No Yes
18m30 Beneath Action Fantasy Yes No No
18m31 Despicable Me Animation Action Yes Yes No
Complete the structured query language (SQL) to return the category number and title for all Comedy movies.
.................................................. 2018MOV
WHERE Genre1 = ..................................................;
[2]
[2 marks]
Page 2 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
8/11
Combined By NESRINE
Question 2
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.
Using the query-by-example grid, write a query to identify at risk trees over 100 years old.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
[4 marks]
Page 3 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
9/11
Combined By NESRINE
Question 3
A database was set up to show the properties of certain chemical elements. Part of the database is shown below.
Name of Element Atomic Atomic Melting Boiling State at
element symbol number weight point (C) point (C) room temp
oxygen O 8 16 –218 –183 gas
iron Fe 26 56 1538 2861 solid
mercury Hg 80 201 –38 356 liquid
bromine Br 35 80 –7 59 liquid
osmium Os 76 190 3033 5012 solid
caesium Cs 55 133 28 671 solid
gallium Ga 31 70 30 2204 solid
argon Ar 18 40 –189 –186 gas
silver Ag 47 108 961 2162 solid
The following search condition was entered:
(Melting point (C) < 40) AND (Atomic weight > 100)
Using Element symbol only, which records would be output?
[2]
[2 marks]
Page 4 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
10/11
Combined By NESRINE
Question 4
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
SPO Thriller 86000 46859 39141 0
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]
[4 marks]
Page 5 of 6
© 2015-2023 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
11/11