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

Q15 · 9618/11/O/N/21 Q5

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

Q159618/11/O/N/21original Q5Structured · 10 marks
Question 5 from 9618/11/O/N/21

Worked solution

(a)

MANAGER.ManagerID: primary key. SHOP.ManagerID: foreign key. CAR.RegistrationNumber: primary key. CAR.ShopID: foreign key.

TableField namePrimary keyForeign key
MANAGERManagerID✓
SHOPManagerID✓
CARRegistrationNumber✓
CARShopID✓

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 IDEAA 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

Mark scheme for 9618/11/O/N/21 question 5
VIDEO
▶ Whole paper

Video solution of the whole paper · by qiphyedu. 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.