human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the names of all the persons who are friends with Alice?
assistant
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Alice';
human
Okay, could you show me Zach's job?
assistant
SELECT job FROM person WHERE name = 'Zach';
human
How old is Zach?
assistant
SELECT age FROM person WHERE name = 'Zach';
human
How many years has Zach been friends with Alice?
assistant
SELECT year FROM personfriend WHERE friend = "Alice" AND name = "Zach" ;