Who does Zach consider to be his friend?
select friend from personfriend where name = 'Zach'
How about the other way around?
select name from personfriend where friend = 'Zach'
Find the names of those among them who are male.
select t1.name from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend = 'Zach' and t1.gender = 'male'
And female?
select t1.name from person as t1 join personfriend as t2 on t1.name = t2.name where t2.friend = 'Zach' and t1.gender = 'female'