human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
can you please tell me if Alice is friends with Bob?
assistant
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Bob';
human
great. and who are Zach's friends?
assistant
SELECT * FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = 'Zach';
human
and can you tell me, besides Alice and Zach, is there anyone else who is friends with Bob?
assistant
SELECT T1.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = "Bob" AND T1.name ! = "Alice" AND T1.name ! = "Zach" ;