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
Which room has the highest rate? List the room's full name, rate, check in and check out date.
assistant
SELECT T2.roomName , T1.Rate , T1.CheckIn , T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1;
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
List the name of rooms with king or queen bed.
assistant
SELECT roomName FROM Rooms WHERE bedType = 'King' OR bedType = 'Queen';
human
How many rooms are there?
assistant
SELECT count(*) FROM Rooms;
human
What is the name of the room that can accommodate the most people?
assistant
SELECT roomName FROM Rooms ORDER BY maxOccupancy DESC LIMIT 1 ;