2.4 Data Bases
2.4 Data Bases
STUDENTS NAME:
_____________________________________________
_____________________________________________
_____________________________________________
Follow On Facebook :
https://www.facebook.com/shahza
CONTACT NUMBER: dah.ashraf
_____________________________________________
...............................................................................................................................................[1]
2210/21/M/J/15
(b) State which field you would choose for the primary key.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) State the data type you would choose for each of the following fields.
Garage .....................................................................................................................................
Price in $ ..............................................................................................................................[3]
(d) The query-by-example grid below selects all houses with more than 1 bathroom and more
than 2 bedrooms.
Number of Number of
Field: Property Type Price in $ Brochure No
Bedrooms Bathrooms
Table: PROPERTY PROPERTY PROPERTY PROPERTY PROPERTY
Sort: Ascending
Show:
Criteria: = 'House' >2 >1
or:
...................................................................................................................................................
...............................................................................................................................................[2]
(e) Complete the query-by-example grid below to select and show the brochure number, property
type and price of all properties with a garage below $200,000.
Field:
Table:
Sort:
Show:
Criteria:
or:
[4]
2210/21/M/J/15
6 A database, MARKS, was set up to record the test results for a class of students. Part of the
database is shown below.
...............................................................................................................................................[1]
(b) State which field you would choose for the primary key.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) The query-by-example grid below selects all students with more than 60 marks in History or
more than 60 marks in Geography.
Sort: Ascending
Show: ✓
Criteria: >60
or: >60
...................................................................................................................................................
...............................................................................................................................................[2]
2210/22/M/J/15
(d) Complete the query-by-example grid below to select and show the student names only of all
students with less than 40 marks in both Maths and English.
Field:
Table:
Sort:
Show:
Criteria:
or:
[3]
2210/22/M/J/15
6 A database, STAFFPHONE, was set up to show the telephone extension numbers for members of
staff working in a department store.
(a) Explain why none of the fields in the database can be used as a primary key.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[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]
2210/21/M/J/16
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.
...............................................................................................................................................[1]
(b) State which field you would choose for the primary key.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(c) State the data type you would choose for each of the following fields.
Price in $ ..............................................................................................................................[2]
2210/22/M/J/16
(d) The query-by-example grid below selects all the furniture in cream leather.
...................................................................................................................................................
...............................................................................................................................................[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]
2210/22/M/J/16
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.
(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.
2210/21/M/J/17
(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]
2210/21/M/J/17
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.
(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]
2210/22/M/J/17
6 A database table, PERFORMANCE, is used to keep a record of the performances at a local
theatre.
Fields ........................................................................................................................................
Records ....................................................................................................................................
[2]
(b) Give two validation checks that could be performed on the Show Number field.
...................................................................................................................................................
...................................................................................................................................................
[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]
2210/21/M/J/18
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.
...............................................................................................................................................[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]
2210/22/M/J/18
6 A picture gallery owner has decided to set up a database to keep information about the pictures
he has for sale. The database table, PICTURE, will contain the following fields:
Title; Artist; Description; Catalogue Number; Size (area in square centimetres); Price; Arrived (date
picture arrived at gallery); Sold (whether picture is already sold)
(a) (i) State what data type you would choose for each field.
Title ...................................................................................................................................
Artist ..................................................................................................................................
Description ........................................................................................................................
Size ...................................................................................................................................
Price ..................................................................................................................................
Arrived ...............................................................................................................................
Sold ...............................................................................................................................[4]
(ii) State which field you would choose for the primary key.
.......................................................................................................................................[1]
(b) Give a validation check that you can perform on each of these fields. Each validation check
must be different.
Size ...........................................................................................................................................
Price .........................................................................................................................................
Arrived ..................................................................................................................................[4]
(c) Complete the query-by-example grid below to select and show the Catalogue Number, Title
and Price of all unsold pictures by the artist ‘Twister’.
Field:
Table:
Sort:
Show:
Criteria:
or:
[5]
2210/22/O/N/15
5 A motor boat hire company decides to set up a database to keep information about boats that are
available for hire. The database table, BOAT, will contain the following fields:
Boat Name; Model; Engine Power (in hp); Number of Seats; Life Raft (whether there is a life raft
kept on the boat); Day Price (price for a day’s hire).
(a) Give the data type you would choose for each field.
Model ........................................................................................................................................
(b) State a validation check that you can perform on each of these fields. Each validation check
must be different.
Model ........................................................................................................................................
(c) Complete the query-by-example grid below to select and show the Boat Name, Model and
Day Price of a day’s hire for all boats with 4 seats and an Engine Power of more than 100 hp.
Field:
Table:
Sort:
Show:
Criteria:
or:
[5]
2210/23/O/N/15
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
.............................................................................................................................................. [1]
(b) State the data type you would choose for each of the following fields.
Play ..........................................................................................................................................
(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
Sort: Ascending
Show:
Criteria: > 100
...................................................................................................................................................
...................................................................................................................................................
.............................................................................................................................................. [3]
2210/22/O/N/16
(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]
2210/22/O/N/16
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.
(a) Explain why none of the fields in the database can be used as a primary key.
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[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]
2210/23/O/N/16
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.
(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]
2210/22/O/N/17
6 A wildlife park has a database table, called LIVESTOCK, to classify and record its animal species.
Part of the database table is shown.
(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.
Purpose ....................................................................................................................................
...................................................................................................................................................
(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]
2210/23/O/N/17
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.
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.
Sort:
Show:
Criteria: >50.00
or:
Error 1 .......................................................................................................................................
...................................................................................................................................................
Error 2 .......................................................................................................................................
...................................................................................................................................................
Error 3 .......................................................................................................................................
...................................................................................................................................................
[3]
2210/22/O/N/18
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.
(a) State whether any of the fields shown would be suitable as a primary key.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[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.
2210/23/O/N/18
(c) Show the output that would be given by this query-by-example.
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]
2210/23/O/N/18
Page 6 Mark Scheme Syllabus Paper
Cambridge O Level – May/June 2015 2210 21
7 (a) – 7 [1]
(b) – Brochure No
– Uniquely identifies each property [2]
(e)
Field: Property Type Garage Price in $ Brochure No
Sort:
Show:
or:
or
Field: Property Type Garage Price in $ Brochure No
Sort:
Show:
or:
or
Field: Property Type Garage Price in $ Brochure No
Sort:
Show:
or:
or
Field: Property Type Garage Price in $ Brochure No
Sort:
Show:
or:
6 (a) – 7 [1]
(b) – Class ID
– Uniquely identifies each student [2]
(d)
Field: Student Name Maths English
Sort:
Show:
or:
– ….. Uniquely identifies each member of staff//no duplicates//different for each member of
staff
[2]
(c)
7 (a) – 7 [1]
(d) 1 mark for each correct result, 1 mark for the results in descending order of price
(e)
Sort:
Show:
Criteria: >2
or:
[5]
2210/21 Cambridge O Level – Mark Scheme May/June 2017
PUBLISHED
ScreenSize Number
3D Boolean
CurvedFlat Text
Internet Boolean
HDD Boolean
Price Currency
5(a) for each field name (1), data type and sample (1) 8
The following are examples there are many different correct answers.
- EarTag (1), text, EAR1011 (1)
- DOB (1), date, 4/3/2017 (1)
- Gender (1), text, M (1)
- Weight (1), number, 5.9 (1)
5(b) EarTag 1
6(a) Fields 5 2
Records 8
6(a) Fields 5 1
6(b) One mark description of new code that will allow more than 1000 values 2
One mark for example matching candidate’s description
Example
Use a new character instead of N
TT345
(c)
Field: Catalogue Title Price Artist Sold
Number
Sort:
Show:
or:
(c)
Field: Boat Name Model Day Price Number of Engine
Seats Power
Sort:
Show:
or:
(1 mark) (1mark) (1 mark) (1 mark) (1 mark) [5]
Page 5 Mark Scheme Syllabus Paper
Cambridge O Level – October/November 2016 2210 22
5 (a) – 6 [1]
(b)
– Play text
– No Seats Stalls number
– Price Stalls Seats $ currency [3]
(c) 1 mark for correct plays, 1 mark for correct dates with each play and no extra fields or
text, 1 mark for the order
As You Like It 01/07/2016
Julius Caesar 22/07/2016
Macbeth 14/07/2016
[3]
(d)
Field: Play Performance Date Number Seats Circle Price Circle Seats $
Sort: Ascending/
Descending
Show: ; ; ;
Criteria: >=6
or:
6 (a) – Town has duplicate entries/all fields can have duplicate entries
– fields other than Town not suitable identifiers [2]
(c)
Sort: Ascending
Show: ; ; ;
Criteria:
or:
1 mark for each column + 1 mark for correct fields only [4]
2210/22 Cambridge O Level – Mark Scheme October/November
PUBLISHED 2017
Question Answer Marks
6(a) – 1 mark for each field suitable name, 1 mark for appropriate data type and appropriate data sample 6
The following are examples there are many different correct answers.
Example 1:
Field Name: SPECIESID
Data Type: Alphanumeric
Purpose: Primary key
Example Data: SP06583
Example 2:
Field name: NUMBER
Data Type: Integer
Purpose: To record how many of that species there are at the park
Example Data: 30
6(b) 4
Field: Species Classification Diet Legs
Table: LIVESTOCK LIVESTOCK LIVESTOCK LIVESTOCK
Sort: Ascending/
Descending
Show: ;
Criteria: “Mammal” “Herbivore” 4
or:
(1 Mark) (1 Mark) (1 Mark) (1 Mark)
6(a) Many correct answers, an example is given. 1 mark for each correct row (max 4). 4
Size Text
Type Text/Boolean
Price in $ Number/Currency
Size3 Number
Size2 In Boolean/Text
2210/23 Cambridge O Level – Mark Scheme October/November 2018
PUBLISHED
Question Answer Marks
Peach 9.25 No
Plum 8.95 Yes
Nectarine 8.50 Yes
Sort: Ascending
Show: ; ; ; ;
or: