Hi can you tell me in witch city does Alice live?
select city from person where name = "Alice"
Great, how many males friends does she have?
select count ( * ) from person as t1 join personfriend as t2 on t1.name = t2.friend where t2.name = 'Alice' and t1.gender = 'male'
What job does he have?
select job from person as t1 join personfriend as t2 on t1.name = t2.friend where t2.name = 'Alice' and t1.gender = 'male'