Worked solution from the Databases Paper 1 Theory Fundamentals booklet, Part 1 of 2.
Draw a line between each pair of linked tables, with a crow's foot on the many side:
CUSTOMER 1 : M SHOP_ORDER (crow's foot at SHOP_ORDER) SUPPLIER 1 : M ITEM (crow's foot at ITEM) SHOP_ORDER 1 : M ORDER_ITEM (crow's foot at ORDER_ITEM) ITEM 1 : M ORDER_ITEM (crow's foot at ORDER_ITEM)
CUSTOMER to SHOP_ORDER is 1:M [1]
SUPPLIER to ITEM is 1:M [1]
SHOP_ORDER to ORDER_ITEM is 1:M and ORDER_ITEM to ITEM is M:1 [1]
Write three advantages (any three):
Reduced data redundancy [1]
Improved data integrity and consistency [1]
Allows views or improved privacy [1]
Other accepted: program-data independence, complex queries can be run.
CREATE DATABASE SHOP;
CREATE DATABASE SHOP; [1]
Join ORDER_ITEM to SHOP_ORDER on OrderNo, pick the customer, then add up Quantity.
SELECT SUM(Quantity) FROM ORDER_ITEM, SHOP_ORDER WHERE ORDER_ITEM.OrderNo = SHOP_ORDER.OrderNo AND SHOP_ORDER.CustomerID = 'HJ231';
SUM(Quantity) [1]
FROM both tables [1]
Join condition ORDER_ITEM.OrderNo = SHOP_ORDER.OrderNo [1]
SHOP_ORDER.CustomerID = 'HJ231' [1]
An INNER JOIN ... ON version scores the same.
▶ Starts at Q3 (25:52)
Starts at Q3 (25:52) · by Pseudocode Pro. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.