human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
What is Zach age?
assistant
SELECT age FROM person WHERE name = 'Zach';
human
Who is the doctor works? | Do you mean whose job is 'doctor'? | Yes
assistant
SELECT name FROM person WHERE job = 'doctor';
human
Who is in the town of new york?
assistant
SELECT name FROM person WHERE city = 'new york city';
human
Who has friends that are younger than the average age?
assistant
SELECT DISTINCT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.age < ( SELECT AVG ( age ) FROM person ) ;