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

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. Q15 9618/11/O/N/21 original Q5 Structured · 10 marks Worked solution (a) MANAGER.ManagerID: primary key . SHOP.ManagerID: foreign key . CAR.RegistrationNumber: primary key . CAR.ShopID: foreign key . Table Field name Primary key Foreign key MANAGER ManagerID ✓ SHOP ManagerID ✓ CAR RegistrationNumber ✓ CAR ShopID ✓ Two or three correct ticks [1] All four correct [1] (b) Access rights give Javier and the managers access to different parts of the database. [1] Do this with different accounts (logins) that have different rights, for example read only, read and write, or no access. [1] Give each user a specific view , for example a manager only sees the data for their own shop(s). [1] (c)(i) SELECT COUNT(RegistrationNumber) FROM CAR GROUP BY ShopID RegistrationNumber inside COUNT [1] Table CAR [1] GROUP BY [1] (c)(ii) INSERT INTO CAR VALUES ("123AA","Tiger","Lioness",10500,"12BSTREET") INSERT INTO [1] VALUES [1] KEY IDEA A primary key identifies a row, a foreign key links to another table, and GROUP BY lets COUNT work out one total per group. TOTAL 10 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.