human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
Who considers Alice to be their friend?
assistant
SELECT name FROM personfriend WHERE friend = 'Alice';
human
How about the other way around?
assistant
SELECT friend FROM personfriend WHERE name = 'Alice';
human
Find the names of those among them who are male.
assistant
SELECT T2.friend FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = "Alice" AND T1.gender = "male" ;