human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
How many different people are over 40?
assistant
SELECT COUNT( DISTINCT name ) FROM person WHERE age > 40;
human
How about under?
assistant
SELECT COUNT( DISTINCT name ) FROM person WHERE age < 40;
human
How many are male?
assistant
SELECT COUNT( DISTINCT name ) FROM person WHERE age < 40 AND gender = "male" ;