CREATE TABLE lives_in (stuid NUMBER, dormid NUMBER, room_number NUMBER)
CREATE TABLE has_amenity (dormid NUMBER, amenid NUMBER)
CREATE TABLE dorm_amenity (amenid NUMBER, amenity_name CLOB)
CREATE TABLE student (stuid NUMBER, lname CLOB, fname CLOB, age NUMBER, sex CLOB, major NUMBER, advisor NUMBER, city_code CLOB)
CREATE TABLE dorm (dormid NUMBER, dorm_name CLOB, student_capacity NUMBER, gender CLOB)

Find the number of students whose age is older than the average age 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"