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

Q4 · 2210/22/O/N/20 Q7

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

Q42210/22/O/N/20original Q7Structured · 7 marks
Question 7 from 2210/22/O/N/20

Worked solution

(a)

Count the rows (not the heading row): A01 to A05, S01 to S07, S20, S21, S22, S25 and T19.

Write: 17 [1]

(b)

Write: Fieldname: PartNum [1]

Reason: the data in this field is unique for each record. [1]

(c)

Show all four fields. Sort Cost from largest to smallest. Quantity < 10 is the only criteria.

PartNumDescriptionCostQuantity
TableAUDIOPARTSAUDIOPARTSAUDIOPARTSAUDIOPARTS
SortDescending
Show✓✓✓✓
Criteria<10
or

All four fields and the table name AUDIOPARTS correct [1]

Sort row: Descending under Cost [1]

Show row: all four boxes ticked [1]

Criteria: <10 under Quantity [1]

KEY IDEAA primary key holds values that never repeat.
TOTAL 7 marks

Official mark scheme

Mark scheme for 2210/22/O/N/20 question 7
VIDEO
▶ Whole paper

Video solution of the whole paper · by Quixotic Academy. 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.