human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
How many people are a friend of Alice?
assistant
SELECT COUNT( * ) FROM personfriend WHERE name = 'Alice';
human
How many people are not a friend of Alice?
assistant
SELECT COUNT( * ) FROM person WHERE name NOT IN ( SELECT friend FROM personfriend WHERE name = 'Alice' );
human
Who among the friends of Alice is 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" ;