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
List the name of all rooms sorted by their prices.
assistant
SELECT roomName FROM Rooms ORDER BY basePrice;
human
Find the number of rooms for each bed type.
assistant
SELECT bedType , count(*) FROM Rooms GROUP BY bedType;
human
Find the number of rooms that do not have any reservation.
assistant
SELECT count(*) FROM rooms WHERE roomid NOT IN (SELECT DISTINCT room FROM reservations)
human
Find the name and id of the top 3 expensive rooms.
assistant
SELECT RoomId , roomName FROM Rooms ORDER BY basePrice DESC LIMIT 3;
human
What is the total number of people who could stay in the modern rooms in this inn?
assistant
SELECT sum(maxOccupancy) FROM Rooms WHERE decor = 'modern';
human
What is the total number of rooms available in this inn?
assistant
SELECT COUNT( * ) FROM Rooms ;