9618/12/O/N/21 question 6: worked solution (October/November 2021, paper 12)

Show as plain text

Cambridge AS Level Computer Science 9618 · 8.3 Data Definition Language (DDL) and Data Manipulation Language (DML) Worked solution from the Databases Paper 1 Theory Fundamentals booklet, Part 2 of 2. Q16 9618/12/O/N/21 original Q6 Structured · 15 marks Worked solution (a)(i) Task 0NF to 1NF 1NF to 2NF 2NF 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 IDEA Normalisation 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 VIDEO ▶ Starts at Q6 (25:46) Starts at Q6 (25:46) · by HyperDavester. Tap the picture to open it on YouTube.