Find the number of students whose age is older than the average age for each gender.
CREATE TABLE student (sex VARCHAR, age INTEGER)
SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex
<s>[INST] Write mssql query to answer the following question given the database schema. Schema: CREATE TABLE student (sex VARCHAR, age INTEGER) Question: Find the number of students whose age is older than the average age for each gender. [/INST] SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex </s>