Rooms Free on a Date
Medium
Hotel & Booking Systems
Return the rooms (101-103 in the Rooms table) with no booking covering the night of 2026-07-03 (check_in <= date < check_out). Order by room.
Table schema
Rooms(room INT PRIMARY KEY)
Bookings(id INT PRIMARY KEY, room INT, guest VARCHAR(10), check_in DATE, check_out DATE)Sample data
Rooms
room
101
102
103
Bookings
id | room | guest | check_in | check_out
1 | 101 | Ann | 2026-07-01 | 2026-07-05
2 | 101 | Bob | 2026-07-04 | 2026-07-08
3 | 102 | Cy | 2026-07-02 | 2026-07-04
4 | 101 | Dee | 2026-07-08 | 2026-07-10
5 | 103 | Eli | 2026-07-06 | 2026-07-10
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.