How many unique apartment type codes are there?
select count(distinct apt_type_code) from apartments
Show the number of apartments for each code.
select apt_type_code, count(*) from apartments group by apt_type_code
Which are the most two common apartment type codes?
select apt_type_code from apartments group by apt_type_code order by count(*) desc limit 2
How about the top 1?
select apt_type_code from apartments group by apt_type_code order by count(*) desc limit 1