who are Dan's friends?
select distinct t1.name from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend = 'Dan'
what is Dan's friend's name and age?
select distinct t1.name, t1.age from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend = 'Dan'