ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions
2 marks · SQL SELECT
The sorted output below was produced by running a query in a database. contractCode contractLength phoneType storage IP24128 24 months iPhone14 128 GB IP18128 18 months iPhone14 128 GB GA18128 18 months Galaxy S22 128 GB GA24256 24 months Galaxy Z 256 GB PI18256 18 months Pixel 6a 256 GB IP18256 18 months iPhone 14 256 GB XP12256 12 months Xperia 5 256 GB IP24512 24 months iPhone 14 512 GB GA24512 18 months Galaxy Z 512 GB Complete the SQL statement used to produce this sorted output. SELECT contractCode, contractLength, phoneType, storage FROM contract ORDER BY
One mark each for: • first sort - storage (ASC) • second sort - contractLength DESC 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.