Last active
December 13, 2015 19:38
-
-
Save oisdk/f94ca76e9c6eeb3e73c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT hotel_name | |
FROM hotels | |
WHERE | |
city = 'Waterford' AND | |
hotel_num IN ( | |
SELECT r.hotel_num | |
FROM rooms AS r | |
WHERE r.room_num NOT IN ( | |
SELECT b.room_num | |
FROM bookings AS b | |
WHERE | |
b.hotel_num = r.hotel_num AND | |
'2016-10-05' BETWEEN b.arr_date AND b.dep_date | |
) | |
GROUP BY hotel_num | |
HAVING COUNT(*) >= 5 | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment