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

Q13 · 2210/21/M/J/23 Q10

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

Q132210/21/M/J/23original Q10Structured · 8 marks
Question 10 from 2210/21/M/J/23

Worked solution

(a)

Write: Field: TVCode [1]

Reason: each entry in this field is a unique identifier. [1]

(b)

Choose a different type for each field: a code with letters and numbers is text, a whole screen size is an integer, YES or NO is Boolean and a price with cents is real.

FieldData type
TVCodeText
ScreenSizeInteger
SmartTVBoolean
Price$Real

Four correct scores 2 marks; two or three correct scores 1 mark. [2]

(c)

Fill in the missing words.

SELECT TVCode, ScreenSize, Price$
FROM TVRange
WHERE SmartTV = YES;

ScreenSize [1]

Price$ [1]

FROM [1]

YES [1]

KEY IDEAPick the data type from the kind of values stored; SQL is SELECT fields, FROM table, WHERE condition.
TOTAL 8 marks

Official mark scheme

Mark scheme for 2210/21/M/J/23 question 10
VIDEO
▶ Whole paper

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