Multiple choice

What will be the output of the following query? Select sum(price) from room r where roomno not in(select roomno from booking b, hotel h where(datefrom<=current_date and dateto>=current_date)and b. hotelno=h.hotelno and hotelname='XYZ')

Hotel(hotelno, hotelname, city) Room(roomno, hotelno, type, price) Booking(hotelno, guestno, datefrom, dateto, roomno) Guest(gustno, guestname, guestadd)

  1. Total revenue/expenditure lost from unoccupied room of XYZ hotel in a specific period

  2. Total revenue/expenditure lost from unoccupied room of XYZ hotel as on date

  3. Total revenue/expenditure lost from occupied room of XYZ hotel as on date

  4. Total revenue/expenditure gained from occupied room of XYZ hotel as on date

  5. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The query retrieves total revenue/expenditure lost from unoccupied room of XYZ hotel as on date. Output: sum(price) or revenue / expenditure Condition: hotelname='XYZ'datefrom<=current_date and dateto>=current_date implies as on date or current date roomno not in implies unoccupied roomno.