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 friends with Dan?
assistant
SELECT COUNT( * ) FROM personfriend WHERE friend = 'Dan';
human
How about for Alice?
assistant
SELECT COUNT( * ) FROM personfriend WHERE friend = 'Alice';
human
Show the name and age of poeple who are friends with either.
assistant
SELECT DISTINCT T1.name , T1.age FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T2.friend = "Dan" OR T2.friend = "Alice" ;