From 116ff09ad8f99bf83ef02c0f43dbc191f67a77c6 Mon Sep 17 00:00:00 2001 From: Lisa Hull Date: Thu, 23 Feb 2017 10:33:02 -0700 Subject: [PATCH 1/3] off by one? --- select-from-world.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select-from-world.sql b/select-from-world.sql index 177e453..c9fdaa5 100644 --- a/select-from-world.sql +++ b/select-from-world.sql @@ -90,7 +90,7 @@ Show per-capita GDP for the trillion dollar countries to the nearest $1000. */ SELECT name, ROUND(gdp/population, -3) FROM world -WHERE gdp > 1000000000000 +WHERE gdp >= 1000000000000 --#11 /* From 5c85015c98714c092d319bae3505eb865ac597e9 Mon Sep 17 00:00:00 2001 From: Lisa Hull Date: Thu, 23 Feb 2017 14:49:30 -0700 Subject: [PATCH 2/3] update #11 + #13 --- select-from-world.sql | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/select-from-world.sql b/select-from-world.sql index c9fdaa5..083eeb8 100644 --- a/select-from-world.sql +++ b/select-from-world.sql @@ -98,11 +98,11 @@ The CASE statement shown is used to substitute North America for Caribbean in th Show the name and the continent - but substitute Australasia for Oceania - for countries beginning with N. */ -SELECT name, continent, - CASE WHEN continent='Caribbean' THEN 'North America' +SELECT name, + CASE WHEN continent='Oceania' THEN 'Australasia' ELSE continent END -FROM world -WHERE name LIKE 'J%' + FROM world + WHERE name LIKE 'N%' --#12 /* @@ -132,4 +132,5 @@ CASE WHEN continent = 'Oceania' THEN 'Australasia' WHEN continent = 'Caribbean' AND name NOT LIKE 'b%' THEN 'South America' ELSE continent END FROM world +WHERE tld IN ('.ag','.ba','.bb','.ca','.cn','.nz','.ru','.tr','.uk') ORDER BY name From c6982c76a4cc3e0b6d1b493cee0cb1613781a4a2 Mon Sep 17 00:00:00 2001 From: Lisa Hull Date: Thu, 23 Feb 2017 15:23:05 -0700 Subject: [PATCH 3/3] fix too many columns error --- select-from-nobel.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/select-from-nobel.sql b/select-from-nobel.sql index 9e15cba..9bacc1c 100644 --- a/select-from-nobel.sql +++ b/select-from-nobel.sql @@ -119,7 +119,7 @@ The expression subject IN ('Chemistry','Physics') can be used as a value - it wi Show the 1984 winners ordered by subject and winner name; but list Chemistry and Physics last. */ -SELECT winner, subject, subject IN ('Physics','Chemistry') +SELECT winner, subject FROM nobel WHERE yr=1984 ORDER BY subject IN ('Physics','Chemistry'),subject,winner