Simple SQL joins — HackerRank -Average Population of Each Continent

SELECT continent, 
Round(Avg(city.population) - 0.5, 0) AS p
FROM city
JOIN (country)
ON( city.countrycode = country.code )
GROUP BY continent
ORDER BY p;

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store