Explain this SQL query in plain English.

Posted by Kevinniceguy on Stack Overflow See other posts from Stack Overflow or by Kevinniceguy
Published on 2010-04-11T04:27:34Z Indexed on 2010/04/11 5:13 UTC
Read the original article Hit count: 219

Filed under:
|
|
|

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_DATE AND
dateTo >= CURRENT_DATE) AND
b.hotelNo = h.hotelNo AND hotelName = 'Paris Hilton');

© Stack Overflow or respective owner

Related posts about database

Related posts about dbms