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

Q19 · 2210/22/O/N/24 Q11

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

Q192210/22/O/N/24original Q11Structured · 8 marks
Question 11 from 2210/22/O/N/24

Worked solution

(a)

Count the columns, then the rows of data.

Fields: 11 [1]

Records: 15 [1]

(b)

Write: the Type field contains data that repeats, so it is not unique [1]

(c)

Pick one different field for each type:

FieldData type
RoomNo (or Type)alphanumeric
Mon (or any other day)Boolean
Rate$real
Guestsinteger

Four correct [2]

Note: two or three correct scores [1].

(d)

The statement picks rooms where Mon is not T, that is, where Mon is F. Show only the four named columns.

RoomNoTypeGuestsRate$
104SSingle172.50
105SSingle172.50
201FFamily4160.00
301DDouble2200.00
304PSuite6700.00

Data from the four correct columns [1]

Rows in the order shown, at least two rows and two columns [1]

All data correct with no extra content [1]

KEY IDEA<> means not equal to, so the query returns the rows where Mon is false.
TOTAL 8 marks

Official mark scheme

Mark scheme for 2210/22/O/N/24 question 11
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.