What is the average population of all counties?
select avg(population) from county_public_safety
How many counties have a population more than 20000?
select count(*) from county_public_safety where population > 20000
How many cities are located in these counties?
select count(*) from city where county_id in (select county_id from county_public_safety where population > 20000)