How many friends does Zach have?
select count ( friend ) from personfriend where name = 'Zach'
How long has zach been friends with each of them?
select name,friend,year from personfriend where name = 'Zach'
What are the ages of Zach's friends?
select t1.name,friend,year,age from personfriend as t1 join person as t2 on t1.friend = t2.name where t1.name = 'Zach'
Which person has zach been friends with the longest?
select t1.age from person as t1 join personfriend as t2 on t1.name = t2.friend where t2.name = 'Zach' and t2.year = ( select max ( year ) from personfriend where name = 'Zach' )
What does dan do for work?
select job from person where name = 'Dan'
How old is dan?
select age from person where name = 'Dan'