Add modify bookings scripts and results
This commit is contained in:
16
sql/update_booking.sql
Normal file
16
sql/update_booking.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- modify 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 UpdateBooking (in BookingID int, in Reserved datetime)
|
||||
begin
|
||||
update Bookings as B
|
||||
set B.Reserved = Reserved
|
||||
where B.BookingID = BookingID;
|
||||
if row_count() = 1 then
|
||||
select concat("Booking ", BookingID, " updated") as Confirmation;
|
||||
else
|
||||
select concat("Booking ", BookingID, " wasn't updated - missing booking") as Confirmation;
|
||||
end if;
|
||||
end
|
||||
Reference in New Issue
Block a user