9618/12/M/J/25 question 5: worked solution (May/June 2025, paper 12)
Show as plain textHide 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. Q25 9618/12/M/J/25 original Q5 Structured · 16 marks Worked solution (a) Write any two points: CHARACTER_ITEM is a linking table that removes the many-to-many relationship between CHARACTER and ITEM [1] It lets each character have many items and each item be bought by many characters (it stores the items purchased for each character) [1] (b) Underline these attributes as the primary keys: The three single keys: USER → Username , CHARACTER → CharacterID , ITEM → ItemName [1] The composite key: CHARACTER_ITEM → CharacterID and ItemName together [1] (c)(i) Give two methods, each with its own explanation. Any two of these pairs score: Method: access rights (permissions) [1] Explanation: only users with the right permissions can read or edit the USER table [1] Method: a password on the database or the USER table [1] Explanation: users without the password cannot get at the data [1] Other accepted pairs: encryption (without the key, the data cannot be understood); views (users are given a view that leaves out the USER table). (c)(ii) Write any two ways: Validation on the data entered [1] Enforcing referential integrity (including cascade update / delete) [1] Other accepted ways: cascade update / delete , or making sure the database is normalised . (d)(i) ITEM purchases are in CHARACTER_ITEM, but the username is in CHARACTER, so the two must be joined. SELECT COUNT(ItemName) FROM CHARACTER_ITEM INNER JOIN CHARACTER ON CHARACTER.CharacterID = CHARACTER_ITEM.CharacterID WHERE CHARACTER.Username = "KAT123"; SELECT COUNT [1] FROM the correct tables with a join [1] WHERE condition for the username "KAT123" [1] (d)(ii) UPDATE CHARACTER SET Level = 3, Money = 10000.00 WHERE CharacterID = "0002"; UPDATE CHARACTER [1] SET Level and Money to the new values [1] WHERE CharacterID = "0002" [1] KEY IDEA A linking table splits a many-to-many relationship, and its primary key is made from both foreign keys. TOTAL 16 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Virtual Help. Tap the picture to open it on YouTube.