I am using the Mondial database schema and am trying to find: For each country, find city that has the highest population and the city's population.
Right now I have:
SELECT Country.Name, city.name, MAX(city.population) Population
FROM city
Join Country
On Country.Code=City.Country
WHERE city.population IS NOT NULL
GROUP BY Country.Name, city.name
ORDER BY Country.Name;
This gives me ALL of the cities in each country and their populations and not just the largest city.