how many different types of apartments are there?
select count ( distinct apt_type_code ) from apartments
what are they?
select distinct apt_type_code from apartments
Great! how many apartments does each of them have?
select count ( * ), apt_type_code from apartments group by apt_type_code
yes!
select apt_type_code, count ( * ) from apartments group by apt_type_code
ok, which of them is the most common one?
select apt_type_code from apartments group by apt_type_code order by count ( * ) desc limit 1