human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
Who is the oldest person? | What attributes do you want for this person, name or something else? | name
assistant
SELECT Name FROM Person ORDER BY AGE DESC LIMIT 1;
human
How many friends does Alice have?
assistant
SELECT COUNT( T2.friend ) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = 'Alice';
human
How many of those are women?
assistant
SELECT COUNT( T2.friend ) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T2.name = "Alice" AND T1.gender = "female" ;