Given the following schema Write the SQL query for the follo
Given the following schema:
Write the SQL query for the following:
1. Select the guest name, hotel name, and room price for each guest at each hotel on July 1, 2017.
Hotel hotelID int hotelName char(15) NOT NULL city primary key char(15) NOT NULL Room roomNo int part of a composite key hotelNo intforeign key references Hotel (hotelID) type char(2) either \'db\' (double) or \'sg\' (single) or \'tp\' (triple) price dec(52) 50Solution
1) select g.guestname,h.hotelName,r.price from Hotel h join Room r join Guest g join Booking b where g.guestNo=b.guestNo AND r.roomNo=b.roomNo AND h.hotelNo=b.hotelNo AND \'1-JUL-2017\' BETWEEN dateFrom AND dateTo;

