How many cities are there?
select count(*) from locations
Count the cities by their country ids.
select country_id, count(*) from locations group by country_id