ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
4 marks · SQL SELECT
Complete the SQL statement used to produce this sorted output. SELECT teamID, schoolID, teamName, noOfMembers, technology FROM Team ORDER BY Brainy Bunch from schoolID 214 has been disqualified from the competition. Write the SQL statement to remove them from the table. Teams take part in a technology competition. Their details are stored in a table called Team. The sorted output below was produced by executing a query. teamID schoolID teamName noOfMembers technology T1 936 Pseudo Boom 3 Robot T22 871 Brainy Bunch 4 E‑Glasses T56 658 Thinking Caps 2 Air drone T24 658 B.H.B 2 VR headset T67 402 Fuzz Logic 4 Health tracker T29 214 Alpha 1.0 5 Artificial intelligence T37 214 Successors 3 Land drone T46 214 Brainy Bunch 4 VR headset T99 197 Elec‑tricks 2 Smart watch
• first sort: schoolID DESC • second sort: technology (ASC) Do not award second sort if first sort is missing Second sort mark can still be awarded if first sort is incorrect Ignore syntax errors, for example using AND instead of a comma • DELETE from Team • WHERE teamID = "T46" Also allow use of two fields: schoolID = 214 AND teamName = "Brainy Bunch" Quotes not required