Task: Text to Code
Input (English): Find the number of students whose age is older than the average age for each gender.
Output (English): SELECT count(*) ,  sex FROM student WHERE age  >  (SELECT avg(age) FROM student) GROUP BY sex