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
How many king beds are there?
assistant
SELECT sum(beds) FROM Rooms WHERE bedtype = 'King';
human
List the type of bed and name of all traditional rooms.
assistant
SELECT roomName , bedType FROM Rooms WHERE decor = 'traditional';
human
Find the number of rooms with a king bed.
assistant
SELECT count(*) FROM Rooms WHERE bedType = 'King';
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
Find the number of rooms for each bed type.
assistant
SELECT bedType , count(*) FROM Rooms GROUP BY bedType;
human
Find the number of distinct bed types available in this inn.
assistant
SELECT COUNT( DISTINCT bedType ) FROM Rooms ;