human
Schema:
Rooms (RoomId, roomName, beds, bedType, maxOccupancy, basePrice, decor)
Reservations (Code, Room, CheckIn, CheckOut, Rate, LastName, FirstName, Adults, Kids)
Please answer with SQL.
assistant
Sure, I understand.
human
Find the ids of all the rooms that have been reserved before.
assistant
SELECT DISTINCT room FROM reservations;
human
Which rooms have not had any reservation yet?
assistant
SELECT * FROM rooms WHERE roomid NOT IN ( SELECT DISTINCT room FROM reservations );
human
How many are there?
assistant
SELECT COUNT( * ) FROM rooms WHERE roomid NOT IN ( SELECT DISTINCT room FROM reservations ) ;