0% found this document useful (0 votes)
146 views14 pages

2.3 Databases

The document describes a database called SOFASELECT that stores information about furniture for sale including sofas, suites, chairs, and recliners. It contains fields for description, number of seats, number of pieces, material, color, and price. The primary key would be the brochure number field. The number of seats field would use a numeric data type and the price field would use currency. A query shows furniture in cream leather. Another query is incomplete but would select furniture with 3 or more seats.
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)
146 views14 pages

2.3 Databases

The document describes a database called SOFASELECT that stores information about furniture for sale including sofas, suites, chairs, and recliners. It contains fields for description, number of seats, number of pieces, material, color, and price. The primary key would be the brochure number field. The number of seats field would use a numeric data type and the price field would use currency. A query shows furniture in cream leather. Another query is incomplete but would select furniture with 3 or more seats.
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/ 14

QUESTION 1.

10

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]

© UCLES 2016 0478/22/M/J/16


11

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

© UCLES 2016 0478/22/M/J/16


QUESTION 2. 11

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]

© UCLES 2017 0478/22/M/J/17


QUESTION 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) 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]

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


Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop
13

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

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


Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop
14

BLANK PAGE

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


Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop
15

BLANK PAGE

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


Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop
QUESTION 4. 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 a suitable field to use as the primary key. State a reason for your choice.

Field ..........................................................................................................................................

Reason ......................................................................................................................................

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

(b) Complete the query-by-example grid to display only the stock level and size of all cartons
containing only apple juice.

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

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


Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop
14

BLANK PAGE

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


Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop
15

BLANK PAGE

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


Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop
QUESTION 5. 12

6 Draw the flowchart symbol for Decision and the flowchart symbol for Process.

Decision Process

[2]

7 A convenience store which sells general groceries wants to set up a database table called
STOCK. The table will contain fields including a description of the item, the price of the item
and the number in stock for each item. The STOCK table also has a fourth field to be used as a
primary key.

(a) Complete the table to suggest a suitable field name for each of the four fields in the table
STOCK. Give the purpose of the data to be stored in each field.

Field name Purpose of field contents

[4]

(b) Complete the query-by-example grid to output stock items where the quantity in stock has
fallen below 20. Only show the primary key and description of the items.

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
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 2020 0478/23/M/J/20


Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: www.TeachifyMe.com/Shop
QUESTION 6. 12

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]

© UCLES 2017 0478/21/O/N/17


QUESTION 7. 10

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]

© UCLES 2017 0478/22/O/N/17


11

BLANK PAGE

© UCLES 2017 0478/22/O/N/17

You might also like