Databases and SQL – A Level Computer Science (9618)

14 questions · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
9618/11/O/N/25 · Question 2Oct/Nov 2025Paper 1113 marks
Loading question…
Question text

2
A relational database, WORKEXPERIENCE, stores data about students and the companies where
they complete work experience.
Students can complete multiple work experience placements but can only complete one placement
at a time.
Students can complete more than one placement at the same company.
Part of the database is shown:
STUDENT(StudentID, FirstName, TelephoneNumber, UniversityName)
PLACEMENT( PlacementID, StudentID, CompanyID, StartDate, EndDate,
Complete)
COMPANY(CompanyID, CompanyName, MaxStudentsPerPlacement)
(a) Complete the entity-relationship (E-R) diagram for the database WORKEXPERIENCE.
STUDENT
PLACEMENT
COMPANY
[2]
(b) Explain why the database WORKEXPERIENCE is in Third Normal Form (3NF).
…
…
…
… [2]
ĬÍĊ®Ġ´íÈõÏĪÅĊàû·Ā×
,
,
(c) Some example data from the PLACEMENT table is shown:
PlacementID
StudentID
CompanyID
StartDate
EndDate
Complete
PC001
LDEA01
MSCM
01/01/2023
12/07/2023
TRUE
PC002
LDEA01
MSCM
01/04/2024
08/05/2024
FALSE
PC003
ALAU02
NEAM
09/03/2020
10/03/2021
FALSE
PC004
LOLI75
GOUZ
07/06/2018
11/09/2018
TRUE
(i)
Write a Structured Query Language (SQL) script to delete all placements that have been
completed.
…
…
…
… [2]
(ii)
Write an SQL script to return the total number of placements completed by the student
with ID LDEA01 at the company with ID NEAM. The total should be given an appropriate
name.
…
…
…
…
…
… [4]
ĬÏĊ®Ġ´íÈõÏĪÅĊàù·Ā×
,
,
(d) The database tables are repeated here:
STUDENT(StudentID, FirstName, TelephoneNumber, UniversityName)
PLACEMENT( PlacementID, StudentID, CompanyID, StartDate, EndDate,
Complete)
COMPANY(CompanyID, CompanyName, MaxStudentsPerPlacement)
Explain what is meant by referential integrity, and how it applies to this database.
…
…
…

2
9618/12/O/N/25 · Question 4Oct/Nov 2025Paper 1210 marks
Loading question…
Question text

4
A relational database, SHIPPING, stores data about the ships in a company and the containers
that are carried on the ships.
The database has the following tables:
CONTAINER(ContainerID, Type, Weight, OwnerName, ShipID)
SHIP(ShipID, Type, Capacity, ShipName)
(a) Describe the relationship between the two tables. Refer to the primary and foreign keys in
your answer.
…
…
…
… [2]
(b) The table CONTAINER needs an additional field to store the data for the last inspection date.
Write a Structured Query Language (SQL) script to add one field to the table CONTAINER to
store the date of last inspection of the container, for example 08/07/2019.
…
…
…
… [2]
(c) Write an SQL script to return the number of containers stored in the database for the ship with
the name Caledonia.
…
…
…
…
…
… [4]
ĬÑĊ®Ġ´íÈõÏĪÅĊÞü¶þ×
,
,
(d) Describe the purpose of a developer interface in a Database Management System (DBMS).
…
…
…
… [2]
ĬÓĊ®Ġ´íÈõÏĪÅĊÞú¶þ×

3
9618/13/O/N/25 · Question 5Oct/Nov 2025Paper 1316 marks
Loading question…
Question text

5
A company creates a relational database to store data about its customers.
The database, REVIEWS, stores data about the customers, products, complaints and staff.
The database has four tables:
CUSTOMER(CustomerID, CustomerFirstName, CustomerLastName, CustomerEmail)
PRODUCT(ProductID, ProductName, ProductDetail, Price, Rating)
COMPLAINT(ComplaintID, ProductID, CustomerID, ComplaintDetails, StaffID)
STAFF(StaffID, StaffFirstName, StaffLastName, Department, RemoteWorker)
(a) Complete the entity‑relationship (E‑R) diagram for the database REVIEWS.
CUSTOMER
PRODUCT
COMPLAINT
STAFF
[3]
ĬÑĊ®Ġ´íÈõÏĪÅĊÝùµþ×
,
,
(b) Some example data from the STAFF table is shown.
StaffID
StaffFirstName
StaffLastName
Department
RemoteWorker
1
Ralph
Jura
E
Yes
2
Luca
Emcee
A
Yes
3
Darwin
Acula
F
No
Write a Structured Query Language (SQL) script to define the table STAFF.
…
…
…
…
…
…
…
…
…
…
…
… [4]
(c) Products are given a rating between 1 and 10 inclusive.
Write an SQL script to return only the ProductID, ProductName and ComplaintDetails
for all products with a rating of 5 or less. The results need to be displayed in descending order
of rating.
…
…
…
…
…
…
…
…

Advertisement
4
9618/11/O/N/24 · Question 2Oct/Nov 2024Paper 1117 marks
Loading question…
Question text

2
A shop repairs electronic devices, for example mobile phones and tablet computers. The shop
owner stores the data about the repairs using a file-based approach.
(a) Give one limitation of using a file-based approach to store the data and explain how a
relational database addresses this limitation.
Limitation …
…
Explanation …
…
…
…
[3]
(b) The shop owner creates a relational database called FIXIT.
The database stores data about the customers and the devices for repair.
Some devices need new parts that are ordered from suppliers.
The database FIXIT is designed to include the following tables:
PART(PartID, Description, Price, SupplierID)
CUSTOMER(CustomerID, FirstName, LastName, ContactNumber)
REPAIR(RepairNumber, StartDate, EndDate, CustomerID, Device)
REPAIR_PART(PartID, RepairNumber, Quantity)
(i)
Complete the entity-relationship (E-R) diagram for the given tables.
REPAIR_PART
PART
REPAIR
CUSTOMER
[3]
ĬÍĊ®Ġ´íÈõÏĪÅĊàú·Ā×
,
,
(ii)
The table shows sample data for the table REPAIR_PART.
PartID
RepairNumber
Quantity
ACD128SA
0022
3
PPOR543DWW
0022
1
TR453
0023
1
PPOR543DWW
0023
2
WED5
0024
5
Write a Structured Query Language (SQL) script to define the table REPAIR_PART.
Include constraints (restrictions) on the data that can be entered into each field where
appropriate.
…
…
…
…
…
…
…
…
…
… [5]
ĬÏĊ®Ġ´íÈõÏĪÅĊàü·Ā×
,
,
(iii)
Suppliers send invoices to the company for the parts that are used. A new table,
INVOICE, stores the data about each invoice and whether it has been paid or not.
The design for the table INVOICE is shown:
INVOICE(InvoiceID, SupplierID, AmountDue, Paid, DatePaid)
The table shows sample data for the table INVOICE.
InvoiceID
SupplierID
AmountDue
Paid
DatePaid
000001
JK675
22.50
TRUE
01/01/2024
000002
WR443
358

5
9618/12/O/N/24 · Question 6Oct/Nov 2024Paper 1212 marks
Loading question…
Question text

6
A company uses a relational database to store data about its customers, employees and the
individual repair jobs that customers have booked.
(a) Explain the benefits of using a relational database instead of a file-based approach.
…
…
…
…
…
… [3]
(b) The company decides which employees will work on each repair job. An employee can log
into the database to access information about their repair jobs.
The database is normalised and includes these tables:
•
CUSTOMER stores personal data about each customer
•
EMPLOYEE stores personal data about each employee
•
LOGIN_DATA stores the username and password for each employee
•
JOB stores the data about each repair job
•
JOB_EMPLOYEE stores the employees that are working on each repair job.
(i)
Identify each relationship between the database tables and explain how each relationship
can be implemented in the normalised database.
…
…
…
…
…
…
…
…
…
…
…
… [6]
ĬÑĊ®Ġ´íÈõÏĪÅĊàùµĀ×
,
,
(ii)
The database also has the table INVOICE that stores data about each invoice that is
sent to a customer.
Example data from the table INVOICE is given.
InvoiceID
DateSent
Amount
Paid
JobID
29262
12/12/2023
105.20
Y
221
26765
11/11/2023
200.00
Y
315
13290
02/01/2024
50.00
Y
315
34090
05/02/2024
25.95
N
569
Write a Structured Query Language (SQL) script to return the total amount of all the
invoices sent in the year 2023 that have been paid.
…

6
9618/13/O/N/24 · Question 4Oct/Nov 2024Paper 1319 marks
Loading question…
Question text

4
A company makes ice cream and sells it to shops.
The ice cream is made in batches: a large quantity of one type and flavour of ice cream that is
then split into smaller quantities for sale.
The company’s owner has designed a relational database, ICECREAM, to store data about their
ice cream and customers.
Some of the tables in the database are given. The database is not normalised.
BATCH(BatchID, Type, Flavour, Size, SellingPrice, EndDate)
CUSTOMER(CustomerID, CompanyName, EmailAddress, TelephoneNumber)
SALE(SaleID, BatchID, CustomerID, Quantity, Date)
(a) Identify two foreign keys in the table SALE and the table that each foreign key references.
Foreign key 1 …
Table name 1 …
Foreign key 2 …
Table name 2 …
[2]
(b) Write an SQL script to return the total quantity of ice cream sold to the customer with the ID of
0034E in the year 2023.
…
…
…
…
…
… [3]
Ĭ×Ċ®Ġ´íÈõÏĪÅĊàû¸Ā×
,
,
(c) The table definition for BATCH is repeated here:
BATCH(BatchID, Type, Flavour, Size, SellingPrice, EndDate)
Sample data for the table BATCH is given:
BatchID
Type
Flavour
Size
SellingPrice
EndDate
KlV12
Plain
Vanilla
1
2.20
12/12/2024
RlC14
Plain
Chocolate
0.5
1.80
12/12/2024
TYL1
Non-dairy
Lemon
0.5
2.10
01/02/2025
FYV2
Non-dairy
Vanilla
0.25
1.50
02/02/2025
BIV13
Plain
Vanilla
1
2.20
02/02/2024
(i)
Write an SQL script to define the table BATCH.
Include constraints (restrictions) on the data that can be entered into each field where
appropriate.
…
…
…
…
…
…
…
…
…

7
9618/11/O/N/23 · Question 3Oct/Nov 2023Paper 1111 marks
Loading question…
Question text

3
A shop manager has designed a relational database to store customer orders.
The database will have the following tables:
CUSTOMER(CustomerID, FirstName, LastName, Town)
SHOP_ORDER(OrderNo, CustomerID, OrderDate)
SUPPLIER(SupplierID, EmailAddress, TelephoneNumber)
ITEM(ItemNumber, SupplierID, Description, Price)
ORDER_ITEM(ItemNumber, OrderNo, Quantity)
(a) Complete the entity-relationship (E-R) diagram for the relational database.
CUSTOMER
SHOP_ORDER
ORDER_ITEM
SUPPLIER
ITEM
[3]
(b) Identify three advantages of a relational database compared to a file-based approach.
1 …
…
2 …
…
3 …
…
[3]
(c) (i)
Write a Structured Query Language (SQL) script to define the database called SHOP.
…
… [1]
(ii)
Write the SQL script to return the total quantity of items that the customer with the ID of
HJ231 has ordered.
…
…
…
…
…
… [4]

8
9618/12/O/N/23 · Question 2Oct/Nov 2023Paper 1211 marks
Loading question…
Question text

2
(a) State what is meant by the following terms in a relational database model.
Entity …
…
…
Primary key …
…
…
Referential integrity …
…
…
[3]
(b) Authentication is one method a Database Management System (DBMS) can use to improve
the security of a database.
Describe other methods that a DBMS can use to improve the security of a database.
…
…
…
…
…
…
…
… [4]
(c) The following database table is not normalised.
StudentName
DateOfBirth
TutorGroup
Subject
SubjectCode
English, Maths,
Yuwei Chen
01/09/2004
SMH
EN, MA, CS
Computer Science
Claudia Raj
23/02/2005
JMB
Maths, Physics, Art
MA, PY, AR
Art, Design, English
Aamil Akram
24/01/2005
KMB
AR, DE, EN
language
English language,
Areeba Faraz
21/12/2004
SMH
EN, CH, DE
Chemistry, Design
Explain how to modify the table to put it into First Normal Form (1NF).
…
…
…
…
…
…

Advertisement
9
9618/13/O/N/23 · Question 3Oct/Nov 2023Paper 1318 marks
Loading question…
Question text

3
A company sells online Computer Science courses to students in different countries.
The courses are stored on a public cloud.
(a) (i)
Explain why the company uses a public cloud to store these courses.
…
…
…
… [2]
(ii)
Describe two disadvantages of storing data on a public cloud compared to storing data
on a server in a Local Area Network (LAN).
1 …
…
…
…
2 …
…
…
…
[4]
(iii)
State how the following security measures can be used to protect computer systems.
Firewall …
…
Encryption …
…
Passwords …
…
[3]
(b) The company uses a database, COURSES, to store data about the courses and their tutors.
Each course starts at different times of the year and may have a different tutor.
The database has the following structure:
COURSE_INFORMATION(CourseID, Description, Cost)
TUTOR(TutorID, TelephoneNumber, EmailAddress, TutorName)
COURSE_SCHEDULE(CourseID, DateStarted, TutorID)
(i)
Complete the entity‑relationship (E‑R) diagram for the database COURSES.
COURSE_SCHEDULE
TUTOR
COURSE_INFORMATION
[1]
(ii)
Write the Structured Query Language (SQL) script to return the total number of courses
that have started after 9 September 2023.
The value returned must have an appropriate field name.
…
…
…

10
9618/11/O/N/22 · Question 4Oct/Nov 2022Paper 1115 marks
Loading question…
Question text

4
A photographer creates a relational database to store data about photographs taken at birthday
parties.
The database, PHOTOGRAPHS, stores details of the customer, the party, the photographs taken
and the cameras used.
The photographer has several cameras that are used for taking the photographs at the parties.
Each camera has a specific lens type (for example, XY32Z) and lighting type (for example, F1672).
Data about each photograph is stored in the database including the party at which it was taken,
the time it was taken and the camera used.
The database has these four tables:
CUSTOMER(CustomerID, FirstName, LastName, Telephone)
PARTY(PartyID, CustomerID, PartyDate, StartTime)
PHOTO_DATA(PhotoID, PartyID, TimeTaken, CameraID)
CAMERA_DATA(CameraID, LensType, LightingType)
(a) Complete the entity-relationship (E-R) diagram for the database PHOTOGRAPHS.
PARTY
CUSTOMER
PHOTO_DATA
CAMERA_DATA
[3]
(b) The database is normalised and is in Third Normal Form (3NF).
Describe the characteristics of a database that is in Third Normal Form (3NF).
…
…
…
…
…
… [3]
(c) The table shows some sample data for the table PHOTO_DATA.
PhotoID
PartyID
TimeTaken
CameraID
ST23-56
BD987
08:34
NIK-02
ST23-57
BD987
08:55
NIK-02
ST23-60
BC08
09:01
CAN-01
ST23-61
BC08
10:23
CAN-12
ST23-62
BC08
10:56
NIK-01
(i)
State what is meant by a tuple. Give an example of a tuple from PHOTO_DATA.
Tuple …
…
Example …
…
[2]
(ii)
Complete the Structured Query Language (SQL) script to display the total number of
photographs that have been taken using a camera with a camera ID starting with CAN.
SELECT … ( … )
FROM …
WHERE CameraID LIKE … ;
[4]
(d) Write an SQL script to include two new fields in CAMERA_DATA to store the number of
photographs currently on the camera and the date the camera was last used.
…
…
…
…

11
9618/12/O/N/22 · Question 5Oct/Nov 2022Paper 1211 marks
Loading question…
Question text

5
A relational database, GARDEN, has the following tables:
OWNER(OwnerID, FirstName, TelephoneNo, TreeID, TreePosition)
TREE(TreeID, ScientificName, MaxHeight, FastGrowing)
(a) The database is not in Third Normal Form (3NF).
Explain how the database can be normalised to 3NF.
…
…
…
…
…
… [3]
(b) Write the Structured Query Language (SQL) script to add a new record in the table TREE to
store the following data:
Attribute
Value
TreeID
LOW_1276
ScientificName
Salix_Alba
MaxHeight
30.00
FastGrowing
TRUE
…
…
…
… [3]
(c) State what is meant by a candidate key in a relational database.
…
… [1]
(d) (i)
Describe, using an example, what is meant by a data dictionary.
…
…
…
… [2]
(ii)
Describe what is meant by a logical schema.
…
…
…
… [2]

12
9618/13/O/N/22 · Question 2Oct/Nov 2022Paper 1314 marks
Loading question…
Question text

2
The relational database ASTRONOMY is used to store data about telescopes, the companies that
own the telescopes and the photographs taken by the telescopes.
The database has these three tables:
COMPANY(TelephoneNumber, CompanyID, CompanyName)
PHOTOGRAPH(PhotoID, TelescopeID, DateTaken, TimeTaken, Elevation)
TELESCOPE(TelescopeID, CompanyID, SerialNumber)
(a) Complete the following table by writing the correct answer for each item.
Item
Answer
a suitable field for the primary key in
COMPANY
a candidate key in TELESCOPE
the degree of relationship between
TELESCOPE and PHOTOGRAPH
[3]
(b) A Database Management System (DBMS) has several features.
Identify the feature that describes the relationship between data and its structure.
… [1]
(c) Complete the SQL script to return the total number of telescopes owned by the company
whose ID begins with HW.
SELECT … ( … )
FROM TELESCOPE
WHERE … LIKE … ;
[4]
(d) Write the SQL script to add one field to the table PHOTOGRAPH to store the resolution of the
photograph, e.g. 1920 × 1068.
…
…
…
… [2]
(e) The photographs are stored as bitmap images.
Complete the statements about bitmap images by writing the missing words.
The … of a bitmap image is the number of
bits that are used to store each pixel.
Metadata about the image is stored in the …
of the file.
[2]
(f)
Describe the purpose of a query processor in a DBMS.
…
…
…
… [2]

13
9618/11/O/N/21 · Question 5Oct/Nov 2021Paper 1110 marks
Loading question…
Question text

5
Javier owns many shops that sell cars. He employs several managers who are each in charge of
one or more shops. He uses the relational database CARS to store the data about his business.
Part of the database is shown:
SHOP(ShopID, ManagerID, Address, Town, TelephoneNumber)
MANAGER(ManagerID, FirstName, LastName, DateOfBirth, Wage)
CAR(RegistrationNumber, Make, Model, NumberOfMiles, ShopID)
(a) Tick (  ) one box in each row to identify whether each field is a primary key or a foreign key.
Table
Field name
Primary key
Foreign key
MANAGER
ManagerID
SHOP
ManagerID
CAR
RegistrationNumber
CAR
ShopID
[2]
(b) Describe the ways in which access rights can be used to protect the data in Javier’s database
from unauthorised access.
…
…
…
…
…
… [3]
(c) Javier uses Data Definition Language (DDL) and Data Manipulation Language (DML)
statements in his database.
(i)
Complete the following DML statements to return the number of cars for sale in each
shop.
SELECT COUNT( … )
FROM …
… ShopID
[3]
(ii)
Complete the DML statement to include the following car in the table CAR.
Field
Data
RegistrationNumber
123AA
Make
Tiger
Model
Lioness
NumberOfMiles
10500
ShopID
12BSTREET
…
… CAR
… ("123AA","Tiger","Lioness",10500,"12BSTREET")
[2]

Advertisement
14
9618/12/O/N/21 · Question 6Oct/Nov 2021Paper 1215 marks
Loading question…
Question text

6
A shop sells plants to customers. The shop manager has a relational database to keep track of the
sales.
The database, PLANTSALES, has the following structure:
PLANT(PlantName, QuantityInStock, Cost)
CUSTOMER(CustomerID, FirstName, LastName, Address, Email)
PURCHASE(PurchaseID, CustomerID)
PURCHASE_ITEM(PurchaseID, PlantName, Quantity)
(a) The database is normalised.
(i)
The table lists the following three stages of normalisation:
•
The first stage is from a database that is not normalised (0NF) to First Normal Form
(1NF).
•
The second stage is from 1NF to Second Normal Form (2NF).
•
The third stage is from 2NF to Third Normal Form (3NF).
Tick (  ) one box in each row to identify the appropriate stage for each task.
Normalisation stage
Task
0NF to 1NF
1NF to 2NF
2NF to 3NF
Remove any partial key dependencies
Remove any repeating groups of attributes
Remove any non-key dependencies
[2]
(ii)
Draw an entity-relationship (E-R) diagram for the database PLANTSALES.
CUSTOMER
PLANT
PURCHASE_ITEM
PURCHASE
[3]
(b) The shop manager uses a Database Management System (DBMS).
Describe the purpose and contents of the data dictionary in the DBMS.
…
…
…
…
…
… [3]
(c) The shop manager uses both Data Definition Language (DDL) and Data Manipulation
Language (DML) statements to create and search the database.
(i)
Complete the DML statements to return the total number of items purchased with the
purchase ID of 3011A.
SELECT SUM( … )
FROM …
WHERE … = … ;
[4]
(ii)
Write DDL statements to include a field in the table PURCHASE to store the date of the
order.
…
…
…
… [3]

Advertisement