6
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.
SHOP_ORDER CUSTOMER
ORDER_ITEM SUPPLIER
ITEM
[3]
(b) Identify three advantages of a relational database compared to a file-based approach.
1 ...Reduced Data Redundance.....................................................................
................ ...................................................................................................................................................
2 ....Less Stroage.....................................Stronger Privacy........................................................
.. ... .. .. .. .. .. .. .. .......................................................................................................................
3 ....Data
... .... ... ...Intergrity
... ... ... ....
is ..more accurate and secured...................................................................................
.. ... . . . . .. . .........................................................................................................................................
[3]
© UCLES 2023 9618/11/O/N/23
7
(c) (i) Write a Structured Query Language (SQL) script to define the database called SHOP.
...........................................................................................................................................
.CREATE DATABASE SHOP.......................................................................................
(ii) Write the SQL script to return the total quantity of items that the customer with the ID of
HJ231 has ordered.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.............................SELECT SUM(Quantity)
FROM ORDER_ITEM, SHOP_ORDER
WHERE ORDER_ITEM.OrderNo = SHOP_ORDER.OrderNo
AND SHOP_ORDER.CustomerID = 'HJ231';...................................................................
................................ ................................................................................................. .......
.............................................................................................................................. [4]
© UCLES 2023 9618/11/O/N/23 [Turn over