How many students are there?
select count ( * ) from person where job = "student"
How many persons are there?
select count ( * ) from person
How many friends are there?
select count ( distinct friend ) from personfriend
How many of them are friends with Bob?
select count ( * ) from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend = 'Bob'
What is their name?
select t1.name from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend = 'Bob'
Who is Bob's friend?
select t1.name from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend = 'Bob'
What person has Zach as a friend?
select t1.name from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend = 'Zach'