Hi, how many people have friends with ages above 40?
select count ( * ) from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend in ( select name from person where age > 40 )
Great. What is that person's name?
select t1.name from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend in ( select name from person where age > 40 )