2210/21/M/J/24 question 9: worked solution (May/June 2024, paper 21)
Show as plain textHide plain text
Cambridge O Level Computer Science 2210 · 9.4 Structured query language (SQL) Worked solution from the Databases Paper 2 Algorithms, Programming and Logic booklet, Part 2 of 2. Q17 2210/21/M/J/24 original Q9 Structured · 6 marks Worked solution (a) Write: No , none of the fields would be suitable. None of the fields are likely to contain unique data (many drinks share a name, supplier, container or size) [1] (b) Add up NumberInStock, but only for rows where Container is Can. SELECT SUM (NumberInStock) FROM SoftDrinks WHERE Container = 'Can'; SUM [1] NumberInStock [1] SoftDrinks [1] Container [1] 'Can' [1] KEY IDEA Use SUM to add up a numeric field, and WHERE to pick only the rows you want. TOTAL 6 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by ZAINEMATICS. Tap the picture to open it on YouTube.