human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
How many people are older than 20?
assistant
SELECT COUNT( * ) FROM person WHERE age > 20;
human
How about 30?
assistant
SELECT COUNT( * ) FROM person WHERE age > 30;
human
How many engineers are there?
assistant
SELECT COUNT( * ) FROM person WHERE job = 'engineer';
human
How many people are both engineers and are over 30 years old?
assistant
SELECT COUNT( * ) FROM Person WHERE age > 30 AND job = "engineer" ;