9618/12/M/J/22 question 5: worked solution (May/June 2022, paper 12)

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. Q18 9618/12/M/J/22 original Q5 Structured · 17 marks 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 IDEA A 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 VIDEO ▶ Whole paper Video solution of the whole paper · by Exam Ninja. Tap the picture to open it on YouTube.