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 number of rooms with king bed for each decor type.
assistant
SELECT decor , count(*) FROM Rooms WHERE bedType = 'King' GROUP BY decor;
human
List the name of rooms with king or queen bed.
assistant
SELECT roomName FROM Rooms WHERE bedType = 'King' OR bedType = 'Queen';
human
List the type of bed and name of all traditional rooms.
assistant
SELECT roomName , bedType FROM Rooms WHERE decor = 'traditional';
human
What kind of decor has the least number of reservations?
assistant
SELECT T2.decor FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T2.decor ORDER BY count(T2.decor) ASC LIMIT 1;
human
How many rooms are there?
assistant
SELECT count(*) FROM Rooms;
human
What is the decor of room Recluse and defiance?
assistant
SELECT decor FROM Rooms WHERE roomName = "Recluse AND defiance" ;