Could any please answer the following question. Pleasehelp. 1.) Consider the fol
ID: 3613858 • Letter: C
Question
Could any please answer the following question. Pleasehelp. 1.) Consider the following view defined on the HotelSchema: CREATE VIEW HotelBookingCount (hotelNo, bookingCount) AS SELECT h.hotelNo, Count(*) FROM Hotel h, Room r, Booking b WHERE h.hotelNo = r.hotelNo AND r.roomNo = b.roomNo GROUP BY h.hotelNo; For each of the following querie, state whether the query isvalid and for the valid ones show how each of the queries would bemapped on to a query on the underling base tables. (a) SELECT * FROM HotelBookingCount; Please help. Could any please answer the following question. Pleasehelp. 1.) Consider the following view defined on the HotelSchema: CREATE VIEW HotelBookingCount (hotelNo, bookingCount) AS SELECT h.hotelNo, Count(*) FROM Hotel h, Room r, Booking b WHERE h.hotelNo = r.hotelNo AND r.roomNo = b.roomNo GROUP BY h.hotelNo; For each of the following querie, state whether the query isvalid and for the valid ones show how each of the queries would bemapped on to a query on the underling base tables. (a) SELECT * FROM HotelBookingCount; Please help.Explanation / Answer
a) SELECT * FROM HotelBookingCount; is a valid query... VIEW is a virtual table...we can use querieslike above on VIEWs This query gives all the HotelNo's and number of bookedrooms in that particular hotel grouped byHotelNo