Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created September 19, 2020 12:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save codecademydev/7ebb5a6110c5d6f38f361b4ed8045714 to your computer and use it in GitHub Desktop.
Codecademy export
-- This is the first query:
SELECT DISTINCT year from population_years;
-- Add your additional queries below:
SELECT ROUND(MAX(population),2) AS "Largest population size for Gabon"
FROM population_years
WHERE country LIKE "Gabon";
SELECT country AS "Countries with the lowest population countries in 2005"
FROM population_years
WHERE year=2005
ORDER BY population
LIMIT 10;
SELECT DISTINCT country AS "Countries with a population of over 100 million in the year 2010", ROUND(population,2) AS "Population"
FROM population_years
WHERE year=2010 AND population > 100;
SELECT COUNT(*) AS "Number of countries with the word “Islands” in their name"
FROM population_years
WHERE country LIKE "%_slands%";
SELECT year, population AS "Population of Indonesia"
FROM population_years
WHERE country LIKE "Indonesia" AND year=2000 OR year=2010 and country LIKE "Indonesia" ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment