Show all student names.
select name from person where job = 'student'
How many are there?
select count(*) from person where job = 'student'
Show all people friends with students.
select t2.name from person as t1 join personfriend as t2 on t1.name = t2.friend where t1.name = 'student'
Show all people except these.
select name from person except select t2.name from person as t1 join personfriend as t2 on t1.name = t2.friend where t1.job = 'student'