human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
What city does Alice live in?
assistant
SELECT city FROM person WHERE name = 'Alice';
human
What gender is Alice?
assistant
SELECT gender FROM person WHERE name = 'Alice';
human
What job does Bob do?
assistant
SELECT job FROM person WHERE name = 'Bob';
human
How old is Bob?
assistant
SELECT age FROM person WHERE name = 'Bob';
human
Where does he live?
assistant
SELECT city FROM person WHERE name = 'Bob';
human
How many males are there?
assistant
SELECT COUNT( * ) FROM person WHERE gender = 'male';
human
How about Salt Lake City? | Would you like a list of the names of all the people who live in Salt Lake City? | Who is the oldest person?
assistant
SELECT name FROM person ORDER by age desc LIMIT 1;
human
How old is the doctor named Zach?
assistant
SELECT age FROM person WHERE name = 'Zach';
human
How many male engineers are there?
assistant
SELECT COUNT( * ) FROM person WHERE gender = "male" AND job = "engineer" ;