ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
3 marks · Aggregate functions and grouping
A database table is shown below. Film filmID title releaseDate runTime rating SC1 Spider craze 01/12/2018 117 12A WM1 Waterman 21/12/2018 143 PG IL1 Isn’t it love 13/02/2019 89 12A BW1 Battle of the world 14/02/2019 122 12A HT1 How to train your puppy 22/02/2019 104 PG IC2 Ice cold 22/02/2019 119 15 MB1 Miss Becca 03/03/2019 104 15 TA1 The afterlife 05/03/2019 109 15 CD1 Captain Delsie 08/03/2019 124 12A GB1 Green band 12/03/2019 130 12A Complete the table below showing the expected output from the following SQL statement. SELECT rating, MAX(runTime) AS [Longest movie] FROM Film GROUP BY rating ORDER BY MAX(runTime) DESC; rating Longest movie
• grouping on rating • corresponding values for each rating • sort in descending order 1 mark for each bullet rating Longest movie PG 143 12A 130 15 119
Previous question: Higher Computing Science 2021 Question 10