Cambridge AS Level Computer Science 9618 · 8.1 Database Concepts

Q3 · 9618/13/M/J/22 Q6

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

Q39618/13/M/J/22original Q6Structured · 13 marks
Question 6 from 9618/13/M/J/22

Worked solution

(a)

Write about the keys and the link between the tables:

The primary key StaffID in STAFF [1]

links to the foreign key StaffID in DEVICE. [1]

One staff member can have many devices. [1]

Each device can only be with one member of staff. [1]

This makes it a one-to-many relationship.

(b)(i)

SELECT COUNT(STAFF.StaffID)
FROM STAFF
INNER JOIN DEVICE
ON STAFF.StaffID = DEVICE.StaffID
WHERE STAFF.FirstName = 'Ali'
AND STAFF.LastName = 'Khan';

COUNT [1]

STAFF [1]

ON [1]

AND [1]

(b)(ii)

ALTER TABLE DEVICE
ADD Returned BOOLEAN;

ALTER TABLE DEVICE [1]

ADD with a suitable field name and data type [1]

(c)

1NF: no repeating groups (repeating attributes). [1]

2NF: every attribute depends fully on the whole (composite) primary key, with no partial dependencies. [1]

3NF: every attribute depends on the primary key and on no other attribute, with no non-key (transitive) dependencies. [1]

KEY IDEAA foreign key matches a primary key in another table, which makes a one-to-many link that INNER JOIN can follow.
TOTAL 13 marks

Official mark scheme

Mark scheme for 9618/13/M/J/22 question 6
VIDEO
▶ Whole paper

Video solution of the whole paper · by A Levels Academy Islamabad. 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.