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

Q5 · 2210/23/O/N/20 Q5

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

Q52210/23/O/N/20original Q5Structured · 8 marks
Question 5 from 2210/23/O/N/20

Worked solution

(a)

Fields are the columns: Creature, Class, Quantity, Ready for release, Offspring. Records are the rows of creatures.

Number of fields: 5 [1]

Number of records: 9 [1]

(b)

Only records with Class = Bird are chosen. Only Creature and Ready for release are shown (Class is not ticked).

CreatureReady for release
Short-tailed AlbatrossY
Emperor PenguinY
Yellow-eyed PenguinY

Each correct column scores one mark, up to two. [2]

Or: two correct rows score one mark.

(c)

Four fields are needed because Quantity is used for the sort and Offspring and Ready for release for the criteria. Only Creature is ticked.

CreatureQuantityOffspringReady for release
TableMARINEMARINEMARINEMARINE
SortAscending
Show✓no tickno tickno tick
Criteria=N=Y
or

Correct fields and table name in every column [1]

Sort row: Ascending under Quantity [1]

Show row: only Creature ticked [1]

Criteria: =N under Offspring and =Y under Ready for release [1]

KEY IDEAA field can be used for a sort or a test without being shown.
TOTAL 8 marks

Official mark scheme

Mark scheme for 2210/23/O/N/20 question 5
VIDEO
▶ 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.