Skip to content

Instantly share code, notes, and snippets.

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 sovietsinner/e01fcd910dfc76bb06cbb3902da2047d to your computer and use it in GitHub Desktop.
Save sovietsinner/e01fcd910dfc76bb06cbb3902da2047d to your computer and use it in GitHub Desktop.
World Populations SQL Practice 1
SELECT DISTINCT year from population_years;
SELECT *
FROM population_years
WHERE country IS "Gabon"
ORDER BY population DESC
LIMIT 1;
SELECT *
FROM population_years
WHERE year IS "2005"
ORDER BY population ASC
LIMIT 10;
SELECT *
FROM population_years
WHERE population > 100 AND year IS "2010";
SELECT DISTINCT country
FROM population_years
WHERE country LIKE "%ISLANDS%";
SELECT *
FROM population_years
WHERE country IS "Indonesia" AND (year = "2000" or year = "2010") ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment