2210/23/O/N/23 question 9: worked solution (October/November 2023, paper 23)

Show as 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. Q16 2210/23/O/N/23 original Q9 Structured · 11 marks Worked solution (a) Count the rows of data, then the columns. Records: 14 , Fields: 5 [2] (b)(i) Write: Species (or Description) [1] (ii) The names are long and could easily be misspelt , or a species or description could be duplicated [1] (iii) Write: the code is unique for each species, or it is easy to validate [1] (c) Only rows with NumberBirds greater than 6 are shown: True silver (7) and Brown eared (9). Show only the Species and Description columns. Species Description True silver white laced top half and black lower half Brown eared brown with ear tufts True silver row correct [1] Brown eared row correct [1] (d) Show only Species. Both conditions must be true, so join them with AND. SELECT Species FROM PheasantList WHERE Breeding = "Yes" AND Young = 0; SELECT Species [1] FROM PheasantList [1] Breeding (= "Yes") in the WHERE part [1] AND Young = 0 [1] WHERE Breeding on its own (a yes/no field) also scores. The two conditions can be written in either order. KEY IDEA Count rows and columns carefully, and use AND when both conditions must be true. TOTAL 11 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by O/Alevel CS by Wasiq. Tap the picture to open it on YouTube.