ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
2 marks · Aggregate functions and grouping
A database table is shown below. Car carID model year type price doors FF102 Fierra 2016 Hatchback 12600 5 FF105 Fierra 2018 Hatchback 16100 3 FF165 Fierra 2019 Hatchback 15100 3 CL202 CLC200 2019 Estate 13400 5 CL209 CLC300 2017 Estate 19500 5 GU303 Gulf 2015 Saloon 16500 5 DU405 Duke 2017 Saloon 23000 3 PH283 Phoenix 2017 Hybrid 15300 3 FR302 FirCross 2019 Hybrid 18200 3 Complete the table below showing the expected output from the following SQL statement. SELECT type, MIN(price) as 'Cheapest Price' FROM Car WHERE year >= 2018 GROUP BY type; type Cheapest Price
Award 1 mark for each bullet. • Grouping on type to return three rows • Corresponding values for type of car Award 0 marks if Saloon is included. Example: rows can be in any order type Cheapest Price Hatchback 15100 Estate 13400 Hybrid 18200
Previous question: Higher Computing Science 2023 Question 12