开发者

Explain this SQL query in plain English [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

Please explain, in plain English, what question this SQL query answers:

SELECT SUM(price) FROM Room r, Hotel h

WHERE r.hotelNo = h.hotelNo and hotelName = 'Paris Hilton' and
roomNo NOT IN

(SELECT roomNo FROM Booking b, Hotel h
WHERE (dateFrom <= CURRENT_DAT开发者_StackOverflow社区E AND
dateTo >= CURRENT_DATE) AND
b.hotelNo = h.hotelNo AND hotelName = 'Paris Hilton');


I'm assuming you're asking what does that query do in plain English:

How much would it cost to book all rooms at the "Paris Hilton" hotel that are vacant today?


This query appears to return the sum of the prices of all the rooms in the Paris Hilton hotel which aren't booked for today.


question would be like,

find out list of room that are not booked so far till today in the hotel "Paris Hilton" and return the sum of that amount.


This is probably supposed to represent the total price of rooms available as of today at the "Paris Hilton" hotel. Why they are filtering on both HotelNo and HotelName.

I guess the question would be:

What is the total value of rooms available as of today at the "Paris Hilton" hotel?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜