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.

Here are the three databases, Booking, Guest, and Room. Write a mysql

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!