Worked solution from the Databases Paper 2 Algorithms, Programming and Logic booklet, Part 2 of 2.
Rows with WeightKg = 75 are MT06 (67.35) and MT12 (62.75). ORDER BY PricePerBag sorts from the lowest price, so MT12 comes first.
| MtNo | Name |
|---|---|
| MT12 | Pebbles large |
| MT06 | Cobbles |
Row MT12 Pebbles large [1]
Row MT06 Cobbles [1]
Rows in the correct order [1]
SELECT Name FROM BuildStock WHERE InStock = "No";
Correct SELECT and FROM clauses [1]
Correct WHERE clause (WHERE NOT InStock, InStock = FALSE or NumberBags = 0 also score) [1]
Use the InStock field in the WHERE clause [1]
and check for false / No [1]
Or use the NumberBags field in the WHERE clause and check for 0. Only one of these two routes is needed, so it scores 2 marks.
▶ Topic lesson
A lesson on this topic · by Mr Bulmer's Learning Zone. 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.