What is the total number of people who has no friend living in the city of Austin?
select count ( distinct name ) from personfriend where friend not in ( select name from person where city = 'Austin' )
What about in New York City?
select count ( distinct name ) from personfriend where friend not in ( select name from person where city = 'new york city' )
What about Salt Lake City?
select count ( distinct name ) from personfriend where friend not in ( select name from person where city = 'salt lake city' )
What are their names?
select distinct name from personfriend where friend not in ( select name from person where city = 'salt lake city' )
What are the names of the people with no friends in New York City?
select distinct name from personfriend where friend not in ( select name from person where city = 'new york city' )
How many people in New York City have friends?
select count ( * ) from person as t1 join personfriend as t2 on t1.name = t2.name where person.city = 'new york city'