My solution to the Codecademy Pro Challenge Project World Populations SQL Practice. My first foray with SQL; this exercise required searching a dataset of world populations by country with basic queries to produce answers to a series of questions.

/* Identify unique years from data set */

SELECT DISTINCT year from population_years;

/* Identify highest value for population of Gabon in the dataset */
SELECT ROUND(MAX(population), 2) AS 'Largest Population of Gabon in Dataset (mil)'
FROM population_years
WHERE country = 'Gabon';

/* Identify countries with the 10 smallest populations in 2005 */
SELECT country AS 'Countries with Smallest Populations in 2005 (Ascending)'
FROM population_years
WHERE year = 2005
ORDER BY 1 ASC
LIMIT 10;

/* Find countries with populations over 100mil in 2010 */
SELECT DISTINCT country AS "Countries with Populations over 100 mil in 2010"
FROM population_years
WHERE population > 100 AND year =2010;

/* Find countries with the word 'Islands' in their name */
SELECT DISTINCT country AS 'Countries with the word "Islands" in their name'
FROM population_years
WHERE country LIKE '%Islands%';

/*Display the populations of Indonesia to two decimal places in 2000 and 2010 */
SELECT year, ROUND(population, 2) AS 'Population of Indonesia (mil)'
FROM population_years
WHERE country = 'Indonesia' AND (year = 2000 OR year = 2010);