ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions

N5 Computing Science 2026 Question 16

9 marks · SQL SELECT

The manager would like a list of staff names and number of guests for all bookings after 21:00 with five or more guests. Complete the SQL statement below that would produce this output. SELECT FROM WHERE Mary Joyce is not able to come to work on 4 June 2026. Steven Miller will now serve the bookings that Mary had been allocated. Complete the SQL Statement below to update the database. UPDATE SET WHERE A restaurant manager keeps information about staff and bookings in a relational database. Sample data from both tables is shown below. Staff employeeID staffName contractHours 99 Steven Miller 15 213 Mary Joyce 35 102 Lily Stewart 28 … … … Booking bookingRef tableNum bookingName time date numGuests employeeID A546 5 Smith 18:45 03/04/2026 5 213 A785 10 Howie 15:00 05/04/2026 2 102 B124 2 Barr 19:00 01/04/2026 9 99 F368 6 Grant 12:00 04/04/2026 3 213 … … … … … … …

Marking scheme

• SELECT staffName, numGuests • FROM staff, booking • WHERE time>21:00 • AND numGuests >=5 • AND staff.employeeID = booking.employeeID Select: • fields can be in any order • do not award a mark if additional fields have been included From: • table names can be in any order Where: • conditions can be in any order • second/ third condition must include AND • also accept (and) numGuests > 4 • UPDATE booking • SET employeeID = 99 • WHERE employeeID = 213 • AND date = 04/06/2026

Previous question: N5 Computing Science 2026 Question 15

Next question: N5 Computing Science 2026 Question 17