human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
How old is Dan?
assistant
SELECT age FROM person WHERE name = 'Dan';
human
What city is she from?
assistant
SELECT city FROM person WHERE name = 'Dan';
human
Show all friends of Dan.
assistant
SELECT * FROM personfriend WHERE name = 'Dan';
human
How many friends is this?
assistant
SELECT COUNT( T2.friend ) FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.name WHERE T1.name = "Dan" ;