2210/21/M/J/22 question 6: worked solution (May/June 2022, 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. Q9 2210/21/M/J/22 original Q6 Structured · 5 marks Worked solution (a) Count the field names in the table: GameID, GameName, AgeRestriction, GamePrice, NumberStock, OnOrder, DateLastOrdered, GameDescription. Write: 8 [1] (b) Write: the primary key field must be unique (different) for each record. [1] (c) No stock means NumberStock = 0. On order means OnOrder = "Y". Sort by GameName, A to Z. Show only GameID, GameName and GamePrice. GameID GameName GamePrice NumberStock OnOrder Table GAMES GAMES GAMES GAMES GAMES Sort Ascending Show ✓ ✓ ✓ no tick no tick Criteria =0 ="Y" or Correct fields and table name [1] Correct sort ( Ascending on GameName) and Show boxes [1] Correct criteria: =0 and ="Y" [1] KEY IDEA A primary key value must never repeat; two tests on one row both have to be true. TOTAL 5 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.