-
-
Save codecademydev/fbc332bf57ccb588ec086d1a6f812561 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT(*) FROM countries WHERE continent = 'Africa'; | |
SELECT ROUND(SUM(population),2) FROM population_years JOIN countries ON population_years.country_id = countries.id WHERE year = 2005 AND countries.continent = 'Oceania'; | |
SELECT ROUND(AVG(population),2) FROM population_years JOIN countries ON population_years.country_id = countries.id WHERE year = 2003 AND countries.continent = 'South America'; | |
SELECT * FROM population_years JOIN countries ON population_years.country_id = countries.id WHERE year = 2007 AND population IS NOT NULL ORDER BY population ASC LIMIT 1; | |
SELECT ROUND(AVG(population),2) FROM population_years JOIN countries ON population_years.country_id = countries.id WHERE countries.name = 'Poland'; | |
SELECT count(*) FROM countries WHERE name LIKE '% The %' OR name LIKE 'The %' OR name LIKE '% The' ; | |
SELECT continent, ROUND(SUM(population),2) FROM population_years JOIN countries ON population_years.country_id = countries.id WHERE year = 2010 GROUP BY continent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment