ExamBank Scot · Higher Computing Science question bank · All Higher Computing Science questions
10 marks · Analysis and evaluation
Some of the end‑user requirements used to create the system were to find and display the: • name of the customer who has booked the most expensive trip • name of the captain of the boat with most bookings • total number of boat trips on a specific date. Using the end‑user requirements above, create two functional requirements of the relational database. Functional requirement 1 Functional requirement 2 Sample data from the implemented database tables is shown below. Boat boatID boatName capacity captain B022 Flying Fish 7 Helen Anderson B060 The Aurora 6 Malcolm Smith B102 Maid of the Myth 10 Jabari Mensah B117 Big Blue 20 Jimmy McMenemy B123 Pride of Scotland 8 Lucy McWilliam … … … … Customer custID forename surname address telNo 19 Jason Summers 4 Warden Drive 01332 825671 20 Sue Robertson 12 North Street 01332 321546 21 Fred Cooper 121 Windmill Road 01332 772859 22 Mateusz Popescu 86 View Road 01332 828451 … … … ... ... Booking bookRef custID tripDate partySize timeOut timeIn price R27 22 16/06/2026 6 09:00 12:00 130.00 R28 19 20/06/2026 12 12:00 14:00 260.00 R29 21 22/06/2026 24 10:00 15:00 440.00 R30 20 25/06/2026 23 12:00 16:00 495.00 … … … … … … … BoatBooking bookRef boatID passengers R27 B060 6 R28 B123 8 R28 B022 4 R29 B117 19 R29 B060 5 R30 B102 10 R30 B123 8 R30 B022 5 … … … Caledonia Boating decide to lower the price by £15.00 for any booking where the party size is less than 10 and the trip starts before 12:00. Write the SQL statement for a single query that would change the price for these bookings. Caledonia Boating want to calculate and display the average number of passengers that are booked for a trip on each boat. The expected output is shown below. boatName Average passengers Big Blue 19 Flying Fish 4.5 Maid of the Myth 10 Pride of Scotland 8 The Aurora 5.5 Write an SQL statement to produce this output. A query is produced to show the lowest number of passengers on any boat with a capacity of less than 10 and where the price is greater than £200. The expected output is shown below. boatName Least passengers Pride of Scotland 8 The Aurora 5 Flying Fish 4 The following SQL statement is executed. SELECT boatName, passengers AS [Least passengers] FROM Boat, Booking, BoatBooking WHERE Boat.boatID = BoatBooking.boatID AND capacity < 10 AND price > 200 GROUP BY boatName; When tested, the actual output did not match the expected output. Describe the three errors in the above SQL statement. Error 1 Error 2 Error 3 Caledonia Boating has a number of small boats that customers can book to take them on trips around Loch Lomond. They would like to make use of a relational database to manage their bookings.
Create a query to: • use MAX/search for the highest cost of a boat trip (and display the name of the customer who booked that trip) • use MAX/search for the highest number of booking (and display the name of the captain) • use COUNT/calculate the number of trips on a specific date Award 1 mark for any one bullet. Maximum 2 marks. • correct UPDATE syntax with criteria • calculation and set new value Award 0 marks for first bullet if SQL clauses are in the wrong order. UPDATE Booking SET price = price-15 WHERE partySize < 10 AND timeOut < "12:00" Accept 12,#12:00# or no speech marks/square brackets. • boatName field and alias • AVG(passengers) with tables and equijoin • GROUP BY boatName/boatID Example answer: SELECT boatName, AVG(passengers) AS [Average Passengers] FROM Boat, BoatBooking WHERE Boat.boatID = BoatBooking.boatID GROUP BY boatName • missing MIN around passengers • missing join between Booking and BoatBooking tables • missing ORDER BY MIN(passengers)/[Least passengers] DESC
Previous question: Higher Computing Science 2026 Question 14