Cambridge O Level Computer Science 2210 · 9.4 Structured query language (SQL)

Q14 · 2210/22/M/J/23 Q10

Worked solution from the Databases Paper 2 Algorithms, Programming and Logic booklet, Part 2 of 2.

Q142210/22/M/J/23original Q10Structured · 6 marks
Question 10 from 2210/22/M/J/23

Worked solution

(a)

The primary key must be different for every record. The catalogue number is unique to each song.

Write: SongNumber [1]

(b)

Choose the type that fits the data in each field:

FieldData type
SongNumberText / Alphanumeric
TitleText / Alphanumeric
RecordedDate/time
MinutesReal

SongNumber and Title both correct (text/alphanumeric) [1]

Recorded (date/time) and Minutes (real, as it has decimals like 3.75) both correct [1]

(c)

Look at what each function does to the rock songs.

SUM adds up the Minutes values, so the first statement finds the total number of minutes of music [1]

COUNT counts the Title values, so the second statement finds the total number of songs [1]

Both statements only use records where the genre is rock [1]

KEY IDEAA primary key is unique, data types match the data, SUM adds values and COUNT counts records.
TOTAL 6 marks

Official mark scheme

Mark scheme for 2210/22/M/J/23 question 10
VIDEO
▶ Whole paper

Video solution of the whole paper · by CS BY AQIB KHAN. 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.