List all the apartment type codes with the counts of apartments.
select apt_type_code, count(*) from apartments group by apt_type_code
Order the apartments by the average number of rooms in descending order.
select * from apartments group by apt_type_code order by avg(room_count) desc
From those results, only keep the top 5.
select * from apartments group by apt_type_code order by avg(room_count) desc limit 5
What about top 3?
select * from apartments group by apt_type_code order by avg(room_count) desc limit 3
What are the apartment type codes from those results?
select apt_type_code from apartments group by apt_type_code order by avg(room_count) desc limit 3