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 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
Which room has cheapest base price? List the room's name and the base price.
assistant
SELECT roomName , basePrice FROM Rooms ORDER BY basePrice ASC LIMIT 1;
human
List the type of bed and name of all traditional rooms.
assistant
SELECT roomName , bedType FROM Rooms WHERE decor = 'traditional';
human
How many different types of beds are there?
assistant
SELECT count(DISTINCT bedType) FROM Rooms;
human
Find the names of all modern rooms with a base price below $160 and two beds.
assistant
SELECT roomName FROM Rooms WHERE basePrice < 160 AND beds = 2 AND decor = 'modern';
human
What is the average base price of different bed type? List bed type and average base price.
assistant
SELECT bedType , avg ( basePrice ) FROM Rooms GROUP BY bedType ;