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 for each bed type.
assistant
SELECT bedType , count(*) FROM Rooms GROUP BY bedType;
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 names and decor of rooms that have a king bed. Sort the list by their price.
assistant
SELECT roomName , decor FROM Rooms WHERE bedtype = 'King' ORDER BY basePrice;
human
How many king beds are there?
assistant
SELECT sum(beds) FROM Rooms WHERE bedtype = 'King';
human
Find the number of rooms with a king bed.
assistant
SELECT count(*) FROM Rooms WHERE bedType = 'King';
human
How many rooms have king beds? Report the number for each decor type.
assistant
SELECT decor , COUNT( * ) FROM Rooms WHERE bedType = "King" GROUP BY decor ;