Chapter 7 edit changes

This commit is contained in:
anthonydb 2021-08-15 13:10:57 -04:00
parent d7e741797a
commit 65bdcfaecc
2 changed files with 9 additions and 6 deletions

View File

@ -113,15 +113,18 @@ ORDER BY district_2020.id;
-- Listing 7-9: Using CROSS JOIN
SELECT *
FROM district_2020 CROSS JOIN district_2035;
FROM district_2020 CROSS JOIN district_2035
ORDER BY district_2020.id, district_2035.id;
-- Alternately, a CROSS JOIN can be written with a comma-join syntax:
SELECT *
FROM district_2020, district_2035;
FROM district_2020, district_2035
ORDER BY district_2020.id, district_2035.id;
-- Or it can be written as a JOIN with true in the ON clause:
SELECT *
FROM district_2020 JOIN district_2035 ON true;
FROM district_2020 JOIN district_2035 ON true
ORDER BY district_2020.id, district_2035.id;
-- Listing 7-10: Filtering to show missing values with IS NULL

View File

@ -310,9 +310,9 @@ GROUP BY state_name;
-- Chapter 7: Joining Tables in a Relational Database
----------------------------------------------------------------------------
-- 1. According to the Census population estimates, which county had the
-- 1. According to the census population estimates, which county had the
-- greatest percentage loss of population between 2010 and 2019? Try
-- an Internet search to find out what happened. (Hint: The loss is related
-- an internet search to find out what happened. (Hint: The loss is related
-- to a particular type of facility.)
-- Answer:
@ -337,7 +337,7 @@ ORDER BY pct_change ASC;
-- 2. Apply the concepts you learned about UNION to create query
-- results that merge queries of the Census county population estimates
-- results that merge queries of the census county population estimates
-- for 2010 and 2019. Your results should include a column called year
-- that specifies the year of the estimate for each row in the results.