A1 Database 2025
A1 Database 2025
Explain how to modify the table to put it into First Normal Form (1NF).
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(a) Complete the entity-relationship (E-R) diagram for the relational database.
SHOP_ORDER CUSTOMER
ORDER_ITEM SUPPLIER
ITEM
[3]
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]
The fields RiderLevel and HorseLevel can only have the values: Beginner,
Intermediate or Advanced.
1 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[2]
(ii) Write a Structured Query Language (SQL) script to return the names of all the horses
that have the horse level intermediate or beginner.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(iii) The following SQL script should return the number of riders that have the rider level
beginner and have a lesson booked on 09/09/2023.
OR Date = #09/09/2023#
1 ........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
3 ........................................................................................................................................
...........................................................................................................................................
4 ........................................................................................................................................
...........................................................................................................................................
[4]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [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]
...................................................................................................................................................
............................................................................................................................................. [1]
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.
(a) Complete the entity-relationship (E-R) diagram for the database PHOTOGRAPHS.
PARTY CUSTOMER
PHOTO_DATA CAMERA_DATA
[3]
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [3]
(c) The table shows some sample data for the table PHOTO_DATA.
(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.
FROM .........................................................................................
4 A teacher uses a relational database, MARKS, to store data about students and their test marks.
(a) Describe the advantages of using a relational database compared to a file-based approach.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(b) Give the highest level of Normal Form (NF) the database MARKS is in and justify your choice.
Justification ...............................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[3]
12 A1 50
12 P10 100
13 A1 75
14 P10 60
Write a Structured Query Language (SQL) script to create the table STUDENT_TEST.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [5]
(ii) Write a Structured Query Language (SQL) script to find the average mark of students in
test A7.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
10
6 A shop sells plants to customers. The shop manager has a relational database to keep track of the
sales.
PURCHASE(PurchaseID, CustomerID)
• 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
[2]
PLANT CUSTOMER
PURCHASE_ITEM PURCHASE
[3]
© UCLES 2021 9618/12/O/N/21
PAGE 806
11
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 ..................................................
(ii) Write DDL statements to include a field in the table PURCHASE to store the date of the
order.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [3]
(i) Complete the following Data Definition Language (DDL) statement to define the table
RENTAL.
.......................................................... (RentalID)
);
[4]
(ii) Write a Data Manipulation Language (DML) script to return the first name and last name
of all customers who have not paid their deposit.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]
(i) Complete the following Data Definition Language (DDL) statement to define the table
RENTAL.
.......................................................... (RentalID)
);
[4]
(ii) Write a Data Manipulation Language (DML) script to return the first name and last name
of all customers who have not paid their deposit.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [4]