Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created February 14, 2020 11:56
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/d6b937aefbf51ae8f8898a3c82db5758 to your computer and use it in GitHub Desktop.
Save codecademydev/d6b937aefbf51ae8f8898a3c82db5758 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:
-- Q4
SELECT *
FROM population_years
WHERE country='Gabon'
ORDER BY population DESC
LIMIT 1;
--Q5
SELECT *
FROM population_years
WHERE year = 2005
ORDER BY population ASC
LIMIT 10;
--Q6
SELECT DISTINCT *
FROM population_years
WHERE population >= '1000.00000' AND year = 2010;
--Q7
SELECT DISTINCT country
FROM population_years
WHERE country LIKE '%Islands%';
--Q8
SELECT *
FROM population_years
WHERE country ='Indonesia'
ORDER BY year DESC;
-- subtract 2010 result from 2000 to get the population differences.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment