Could any please answer the following question. Pleasehelp. 1.) Consider the fol
ID: 3613860 • 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 hotelNo FROMHotelBookingCount WHEREhotelNo='H001'; 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 hotelNo FROMHotelBookingCount WHEREhotelNo='H001'; Please help.Explanation / Answer
The given query is not a valid query. For the above query we have to update the view such that it onlycontain the HotelNo and the boked rooms where HotelNo ='H001' usingCREATE or REPLACE VIEW