Worked solution from the Databases Paper 2 Algorithms, Programming and Logic booklet, Part 2 of 2.
Count the rows of data, then the columns.
Records: 14, Fields: 5 [2]
Write: Species (or Description) [1]
The names are long and could easily be misspelt, or a species or description could be duplicated [1]
Write: the code is unique for each species, or it is easy to validate [1]
Only rows with NumberBirds greater than 6 are shown: True silver (7) and Brown eared (9). Show only the Species and Description columns.
| Species | Description |
|---|---|
| True silver | white laced top half and black lower half |
| Brown eared | brown with ear tufts |
True silver row correct [1]
Brown eared row correct [1]
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.
▶ 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.