human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
find the average age
assistant
SELECT AVG ( age ) FROM person;
human
how many are female
assistant
SELECT COUNT( * ) FROM person WHERE gender = 'female';
human
find the number of people whose age is greater than all engineers
assistant
SELECT COUNT( * ) FROM Person WHERE age > ( SELECT MAX( age ) FROM person WHERE job = "engineer" ) ;