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

Q16 · 2210/23/O/N/23 Q9

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

Q162210/23/O/N/23original Q9Structured · 11 marks
Question 9 from 2210/23/O/N/23

Worked solution

(a)

Count the rows of data, then the columns.

Records: 14, Fields: 5 [2]

(b)(i)

Write: Species (or Description) [1]

(ii)

The names are long and could easily be misspelt, or a species or description could be duplicated [1]

(iii)

Write: the code is unique for each species, or it is easy to validate [1]

(c)

Only rows with NumberBirds greater than 6 are shown: True silver (7) and Brown eared (9). Show only the Species and Description columns.

SpeciesDescription
True silverwhite laced top half and black lower half
Brown earedbrown with ear tufts

True silver row correct [1]

Brown eared row correct [1]

(d)

Show only Species. Both conditions must be true, so join them with AND.

SELECT Species
FROM PheasantList
WHERE Breeding = "Yes"
AND Young = 0;

SELECT Species [1]

FROM PheasantList [1]

Breeding (= "Yes") in the WHERE part [1]

AND Young = 0 [1]

WHERE Breeding on its own (a yes/no field) also scores.

The two conditions can be written in either order.

KEY IDEACount rows and columns carefully, and use AND when both conditions must be true.
TOTAL 11 marks

Official mark scheme

Mark scheme for 2210/23/O/N/23 question 9
VIDEO
▶ Whole paper

Video solution of the whole paper · by O/Alevel CS by Wasiq. 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.