human
Schema:
Apartment_Buildings (building_id, building_short_name, building_full_name, building_description, building_address, building_manager, building_phone)
Apartments (apt_id, building_id, apt_type_code, apt_number, bathroom_count, bedroom_count, room_count)
Apartment_Facilities (apt_id, facility_code)
Guests (guest_id, gender_code, guest_first_name, guest_last_name, date_of_birth)
Apartment_Bookings (apt_booking_id, apt_id, guest_id, booking_status_code, booking_start_date, booking_end_date)
View_Unit_Status (apt_id, apt_booking_id, status_date, available_yn)
Please answer with SQL.
assistant
Sure, I understand.
human
Can you show me the top 3 highest room counts?
assistant
SELECT room_count FROM Apartments ORDER by room_count DESC LIMIT 3;
human
For each apartment, can you tell me the average of the bedroom count, bathroom count, and room count? | Do you mean for each apartment type, find the average of the bedroom count, bathroom count, and room count? | yes
assistant
SELECT apt_type_code , AVG ( bathroom_count ) , AVG ( bedroom_count ) , AVG ( room_count ) FROM Apartments GROUP BY apt_type_code;
human
Can you tell me the average number of rooms for each apartment type code?
assistant
SELECT apt_type_code , AVG ( room_count ) FROM Apartments GROUP BY apt_type_code;
human
Can you sort them in descending order?
assistant
SELECT apt_type_code , AVG ( room_count ) FROM Apartments GROUP BY apt_type_code ORDER by AVG ( room_count ) desc;
human
Can you show me just the apartment type codes of the top 3?
assistant
SELECT apt_type_code FROM Apartments GROUP BY apt_type_code ORDER by AVG ( room_count ) desc ;