ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
2 marks · Aggregate functions and grouping
A database table is shown below. Dishes dishName course price portions Chicken wings Starter 8.99 2 Baked haddock Main 15.99 1 Soup of the day Starter 2.50 1 Paté Starter 2.99 2 Brownies to share Dessert 8.99 2 Panacotta Dessert 6.00 1 Mushroom risotto Main 9.99 1 Chicken curry Main 12.99 1 Mixed platter Starter 14.99 4 Complete the table below showing the expected output from the following SQL statement. SELECT course, MIN(price) AS ‘least expensive item’ FROM Dishes WHERE portions >=2 GROUP BY course; course least expensive item
course least expensive item Starter 2.99 Dessert 8.99 1 mark for each correct row Maximum 2 marks 1 mark if two correct, one wrong