Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created April 9, 2020 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/ce774a377a9f079c92ca2e13aa3c4cd8 to your computer and use it in GitHub Desktop.
Save codecademydev/ce774a377a9f079c92ca2e13aa3c4cd8 to your computer and use it in GitHub Desktop.
Codecademy export
/**SELECT COUNT(continent)
FROM countries
WHERE continent='Africa';
SELECT SUM(population)
FROM population_years
JOIN countries
ON countries.id=population_years.country_id
WHERE countries.continent='Oceania' AND year='2005';
SELECT MIN(population)
FROM population_years
JOIN countries
ON countries.id=population_years.country_id
WHERE year='2007';
SELECT AVG(population)
FROM population_years
JOIN countries
ON countries.id=population_years.country_id
WHERE name='Poland';
SELECT COUNT(*)
FROM countries
WHERE name LIKE '%The%';
SELECT *
FROM countries;
SELECT COUNT(name)
FROM countries
WHERE name LIKE '%_The_%';**/
SELECT *
FROM population_years
JOIN countries
ON countries.id=population_years.country_id
WHERE year='2010'
GROUP BY continent
ORDER BY population DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment