Question: Here are the three databases, Booking, Guest, and Room. Write a mysql query to list all details of all rooms at the Grosvenor Hotel, including
Here are the three databases, Booking, Guest, and Room.

Write a mysql query to list all details of all rooms at the Grosvenor Hotel, including the name of the guest staying in the room, if the room is occupied. We can assume the room is occupied when the current date is between dateFrom and dateTo in the booking.
describe Room; + --------- +------- --+---+- ----+------ ---+------- + | Field | Type Null | Key | Default Extra + --------- +------- --+---+- ----+------ ---+------- + | roomNo Tint(3) | hotelNo int(4) | type varchar(9) | price decimal(5,2) YES | YES YES YES | NULL NULL, NULL NULL T | | + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - + describe Guest; + -------------- -------------+------+-----+--------+--+ | Field | Type | Null | Key | Default | Extra + ------------ ----------+----+---------+-------+ | | guestNo I int(7) YES | guestName Tvarchar(30) | YES I guestAddress | varchar(50) | YES NULL NULL NULL + - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - + - - - - - + - - - - - - - - - + - - - - - - - + describe Booking; +----------+--------+------+-----+---------+.......+ | Field Type Null | Key | Default | Extra + - - - - - - - - - - + - - - - - - - + - - - - - + - - - - + - - - - - - - - + - - - - - - - + I | hotelNo int(4) | YES I guestNo Tint(7) | YES dateFrom date YES | dateTo date YES | roomNo int(3) | YES NULL NULL NULL NULL | NULL + - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - + - - - - - - - - - + - - - - - - - +
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
