SELECT count(*) ,  sex FROM student WHERE age  >  (SELECT avg(age) FROM student) GROUP BY sex
How many students are older than average for each gender?
SELECT count ( * ) , sex FROM student WHERE age > ( SELECT avg ( age ) FROM student ) GROUP BY sex
select count ( * ) , sex from student where age > ( select avg ( age ) from student ) group by sex
How many students are older than average for each gender ?