find the number of students living in each city.
select count(*), city_code from student group by city_code
how many of them are male (with sex M)?
select count(*), city_code from student where sex = 'M' group by city_code
Include their average age as well.
select count(*), avg(age), city_code from student where sex = 'M' group by city_code