2210/22/O/N/21 question 6: worked solution (October/November 2021, paper 22)
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. Q8 2210/22/O/N/21 original Q6 Structured · 6 marks Worked solution (a)(i) A Boolean field holds only two values, such as yes or no. Write: InStock [1] (a)(ii) Write: ProductID (it identifies each product, so it is unique). [1] (b) Show ProductID and ProductName. Sort by ProductID. Test Animal = "cat" and InStock = Yes on the same row. ProductID ProductName Animal InStock Table STOCK STOCK STOCK STOCK Sort Ascending Show ✓ ✓ no tick no tick Criteria ="cat" =Yes or Correct field names [1] Correct table names, and Show ticked only for ProductID and ProductName [1] Correct sort: Ascending on ProductID [1] Correct criteria in both columns: ="cat" and =Yes [1] KEY IDEA The primary key is the unique field; Boolean fields hold only two values. TOTAL 6 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.