How many students are older than average for each gender?
CREATE TABLE has_amenity (
    dormid number,
    amenid number
)

CREATE TABLE dorm_amenity (
    amenid number,
    amenity_name text
)

CREATE TABLE dorm (
    dormid number,
    dorm_name text,
    student_capacity number,
    gender text
)

CREATE TABLE student (
    stuid number,
    lname text,
    fname text,
    age number,
    sex text,
    major number,
    advisor number,
    city_code text
)

CREATE TABLE lives_in (
    stuid number,
    dormid number,
    room_number number
)
SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex
Below are sql tables schemas paired with instruction that describes a task. Using valid SQLite, write a response that appropriately completes the request for the provided tables. ### Instruction: How many students are older than average for each gender? ### Input: CREATE TABLE has_amenity (
    dormid number,
    amenid number
)

CREATE TABLE dorm_amenity (
    amenid number,
    amenity_name text
)

CREATE TABLE dorm (
    dormid number,
    dorm_name text,
    student_capacity number,
    gender text
)

CREATE TABLE student (
    stuid number,
    lname text,
    fname text,
    age number,
    sex text,
    major number,
    advisor number,
    city_code text
)

CREATE TABLE lives_in (
    stuid number,
    dormid number,
    room_number number
) ### Response: SELECT COUNT(*), sex FROM student WHERE age > (SELECT AVG(age) FROM student) GROUP BY sex