Worked solution from the Databases Paper 2 Algorithms, Programming and Logic booklet, Part 2 of 2.
A Boolean field holds only two values, such as yes or no.
Write: InStock [1]
Write: ProductID (it identifies each product, so it is unique). [1]
Show ProductID and ProductName. Sort by ProductID. Test Animal = "cat" and InStock = Yes on the same row.
| ProductID | ProductName | Animal | InStock | |
|---|---|---|---|---|
| Table | STOCK | STOCK | STOCK | STOCK |
| Sort | Ascending | |||
| Show | ✓ | ✓ | no tick | no tick |
| Criteria | ="cat" | =Yes | ||
| or |
Correct field names [1]
Correct table names, and Show ticked only for ProductID and ProductName [1]
Correct sort: Ascending on ProductID [1]
Correct criteria in both columns: ="cat" and =Yes [1]
▶ 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.