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

Q3 · 2210/22/M/J/20 Q6

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

Q32210/22/M/J/20original Q6Structured · 6 marks
Question 6 from 2210/22/M/J/20

Worked solution

(a)

Write: Field: Juice code [1]

Reason: it is the only unique identifier (no two records have the same value). [1]

(b)

Only apple juice means both Fruit 1 and Fruit 2 must be Apple. Both criteria go on the same row, so they are joined by AND. Show only Stock level and Size.

Fruit 1Fruit 2SizeStock level
TableJUICEJUICEJUICEJUICE
Sort
Showno tickno tick✓✓
Criteria="Apple"="Apple"
or

Fruit 1 column correct (field, table, no tick, Apple criteria) [1]

Fruit 2 column correct (field, table, no tick, Apple criteria) [1]

Size column correct (field, table, tick) [1]

Stock level column correct (field, table, tick) [1]

The Fruit 1 and Fruit 2 columns may come in any order, as long as the four columns are right.

KEY IDEAA primary key must be unique; criteria on one row work together as AND.
TOTAL 6 marks

Official mark scheme

Mark scheme for 2210/22/M/J/20 question 6
VIDEO
▶ Whole paper

Video solution of the whole paper · by Zafar Ali Khan (ZAK). 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.