Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Rooms Free on a Date

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.