Cambridge AS Level Computer Science 9618 · 8.3 Data Definition Language (DDL) and Data Manipulation Language (DML)

Q16 · 9618/12/O/N/21 Q6

Worked solution from the Databases Paper 1 Theory Fundamentals booklet, Part 2 of 2.

Q169618/12/O/N/21original Q6Structured · 15 marks
Question 6 from 9618/12/O/N/21

Worked solution

(a)(i)

Task0NF to 1NF1NF to 2NF2NF to 3NF
Remove any partial key dependencies✓
Remove any repeating groups of attributes✓
Remove any non-key dependencies✓

One tick in the correct place [1]

All three ticks correct [1]

(a)(ii)

Draw a line between each pair of linked tables. Each has a one-to-many link, with the "many" end at the table that holds the foreign key.

CUSTOMER 1 to many PURCHASE [1]

PURCHASE 1 to many PURCHASE_ITEM [1]

PLANT 1 to many PURCHASE_ITEM [1]

(b)

The data dictionary stores metadata (data about the database). [1]

Write any two items it contains: table names, field (attribute) names, data types, validation rules, primary keys or foreign keys, relationships. [2]

(c)(i)

SELECT SUM(Quantity)
FROM PURCHASE_ITEM
WHERE PurchaseID = "3011A";

Quantity in SUM [1]

PURCHASE_ITEM [1]

PurchaseID [1]

"3011A" [1]

(c)(ii)

ALTER TABLE PURCHASE
ADD OrderDate DATE;

ALTER TABLE PURCHASE [1]

ADD with a field name such as OrderDate [1]

A suitable data type, for example DATE [1]

KEY IDEANormalisation removes repeating groups, then partial dependencies, then non-key dependencies, and SUM adds up a field for the rows that match.
TOTAL 15 marks

Official mark scheme

Mark scheme for 9618/12/O/N/21 question 6
VIDEO
▶ Starts at Q6 (25:46)

Starts at Q6 (25:46) · by HyperDavester. 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.