what is the average age for each gender?
select avg(age), sex from student group by sex
find the number of students whose age is older than the average age of these two groups.
select count(*), sex from student where age > (select avg(age) from student) group by sex