2. (20 points) Please write a stored procedure named pHW2 2 xxxx based on the Ho
ID: 3819011 • Letter: 2
Question
2. (20 points) Please write a stored procedure named pHW2 2 xxxx based on the Hotel, Room and Booking tables. Your program should take one argument hotelname and it should meet the following 2 test cases (10 points) If the given hotel name 2B 10 points) If the given hotel name is 2A. is in the Hotel table, please display the room type empty or null, please display an error message and the number of room booked for each room "invalid hotel name" type for the given hotel name. mysql call pHW2 2 XXXX(NULL); mysql call pHW2 2 xxxx ('Grosvenor'); mysql call pHW2 2 xxxx(); I type I count l message I double l 2 l l Please input a valid hotel name. I family I 1 l single l 2 IExplanation / Answer
Please give the thumbs up, if it is helpful for you. Thank you!!
DELIMITER //
CREATE PROCEDURE pHW2_2_XXXX
(IN con CHAR(20))
BEGIN
SELECT R.type, count(R.types) FROM Room as R inner join Hotel as H
ON R.hotelno=H,hotelno
WHERE H.hotelname = con
ORDER BY R.hotelno;
END //
DELIMITER ;
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.