Add available bookings scripts and results

This commit is contained in:
2024-11-18 15:40:17 +01:00
parent 9308f5471a
commit 0d75c1c035
5 changed files with 166 additions and 0 deletions

10
sql/check_booking.sql Normal file
View File

@@ -0,0 +1,10 @@
-- available bookings - task 2
-- changes:
-- changed BookingDate (Reserved) data type from date to datetime, because I assumed that Little Lemon
-- allows wants bookings per day and table - a table is considered blocked for 2 hours
-- noqa: disable=CP03,LT02,RF03
create procedure CheckBooking (in Reserved datetime, in TableNumber int, out IsFree boolean) --
begin
set IsFree = TableIsFree(Reserved, TableNumber);
select concat("Table ", TableNumber, " is ", if(IsFree, "free", "already booked")) as BookingStatus;
end