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

Q23 · 2210/22/O/N/25 Q7

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

Q232210/22/O/N/25original Q7Structured · 10 marks
Question 7 from 2210/22/O/N/25

Worked solution

(a)

It is used to uniquely identify each record [1]

(b)

Data typeField
BooleanCoastalHabitat
IntegerLifespan
RealLength (or Wingspan)
TextSpecies (or Family)

All four correct [2]

Note: two or three correct scores [1].

(c)

Swans are Bewick's swan (8 years), Mute swan (10) and Whooper swan (9). ORDER BY Lifespan puts them from lowest lifespan to highest.

SpeciesLengthWingspan
Bewick’s swan120.2190.5
Whooper swan150.0230.0
Mute swan150.0220.2

Correct data, spelt correctly [1]

Correct layout of three columns [1]

Correct order [1]

(d)

SELECT Species, Family, Lifespan
FROM WATERFOWL
WHERE Lifespan >= 10
ORDER BY Species;

SELECT Species, Family, Lifespan [1]

FROM WATERFOWL [1]

WHERE Lifespan >= 10 [1]

ORDER BY Species [1]

KEY IDEAORDER BY sorts results, and at least 10 is written as >= 10.
TOTAL 10 marks

Official mark scheme

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

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