-
-
Save codecademydev/abd18e7beb221dc25ee84fe1ba5a7073 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
-- This is the first query: | |
SELECT DISTINCT year from population_years; | |
-- Add your additional queries below: | |
--largest population size for Gabon | |
SELECT * | |
FROM population_years | |
where country ='Gabon' | |
order by population | |
; | |
--10 lowest population countries in 2005 | |
SELECT country, population | |
from population_years | |
where year =2005 | |
order by population ASC | |
limit 10; | |
--distinct countries with a population of over 100 million in 2010 | |
select distinct country | |
from population_years | |
where population > 100 | |
and year = '2010'; | |
--count of countries that have the world "Islands" | |
SELECT count(*) | |
from population_years | |
where country LIKE '%Islands%'; | |
--Differece in population in Indonesia between 2000 and 2010 | |
SELECT population, year | |
from population_years | |
where country = 'Indonesia' and year = 2000 | |
OR country = 'Indonesia' and year = 2010; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment