0% found this document useful (0 votes)
170 views2 pages

Worksheet Database Cambridge With Answer

The document outlines a relational database designed to store customer orders, including tables for CUSTOMER, SHOP_ORDER, SUPPLIER, ITEM, and ORDER_ITEM. It discusses the advantages of relational databases over file-based approaches, highlighting reduced data redundancy, less storage, and improved data integrity. Additionally, it provides SQL scripts for creating the database and querying the total quantity of items ordered by a specific customer.

Uploaded by

daizhuomingdai
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)
170 views2 pages

Worksheet Database Cambridge With Answer

The document outlines a relational database designed to store customer orders, including tables for CUSTOMER, SHOP_ORDER, SUPPLIER, ITEM, and ORDER_ITEM. It discusses the advantages of relational databases over file-based approaches, highlighting reduced data redundancy, less storage, and improved data integrity. Additionally, it provides SQL scripts for creating the database and querying the total quantity of items ordered by a specific customer.

Uploaded by

daizhuomingdai
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/ 2

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

You might also like