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

Q18 · 9618/12/M/J/22 Q5

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

Q189618/12/M/J/22original Q5Structured · 17 marks
Question 5 from 9618/12/M/J/22

Worked solution

(a)

The link table FILM_ACTOR holds the foreign keys, so it is at the "many" end of both links.

ACTOR 1 to many FILM_ACTOR [1]

FILM_FACT 1 to many FILM_ACTOR [1]

(b)

Neither ActorID nor FilmID on its own identifies each row uniquely. [1]

One actor cannot be in the same film twice, so the two together are unique. [1]

(c)

SELECT FILM_ACTOR.ActorID
FROM FILM_ACTOR
INNER JOIN FILM_FACT
ON FILM_FACT.FilmID = FILM_ACTOR.FilmID
WHERE FILM_FACT.FilmTitle = "Cinderella";

FILM_ACTOR.ActorID (or ActorID) [1]

FILM_FACT [1]

FILM_ACTOR.FilmID [1]

"Cinderella" [1]

(d)

SELECT COUNT(FilmID)
FROM FILM_FACT
WHERE ReleaseDate >= #01/01/2022#
AND ReleaseDate <= #31/01/2022#;

COUNT with a correct field name [1]

SELECT and FROM, with the table name FILM_FACT [1]

WHERE clause for January 2022 (BETWEEN #01/01/2022# AND #31/01/2022# also scores) [1]

(e)

Fill the gaps in order:

data dictionary [1]

field names [1]

primary keys (the two can be in either order) [1]

logical schema [1]

query [1]

interface [1]

KEY IDEAA link table with a composite primary key joins two entities in a many-to-many relationship, and an INNER JOIN follows the foreign key.
TOTAL 17 marks

Official mark scheme

Mark scheme for 9618/12/M/J/22 question 5
VIDEO
▶ Whole paper

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