Chapter 7 edit changes
This commit is contained in:
parent
d7e741797a
commit
65bdcfaecc
@ -113,15 +113,18 @@ ORDER BY district_2020.id;
|
|||||||
-- Listing 7-9: Using CROSS JOIN
|
-- Listing 7-9: Using CROSS JOIN
|
||||||
|
|
||||||
SELECT *
|
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:
|
-- Alternately, a CROSS JOIN can be written with a comma-join syntax:
|
||||||
SELECT *
|
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:
|
-- Or it can be written as a JOIN with true in the ON clause:
|
||||||
SELECT *
|
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
|
-- Listing 7-10: Filtering to show missing values with IS NULL
|
||||||
|
|
||||||
|
|||||||
@ -310,9 +310,9 @@ GROUP BY state_name;
|
|||||||
-- Chapter 7: Joining Tables in a Relational Database
|
-- 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
|
-- 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.)
|
-- to a particular type of facility.)
|
||||||
|
|
||||||
-- Answer:
|
-- Answer:
|
||||||
@ -337,7 +337,7 @@ ORDER BY pct_change ASC;
|
|||||||
|
|
||||||
|
|
||||||
-- 2. Apply the concepts you learned about UNION to create query
|
-- 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
|
-- 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.
|
-- that specifies the year of the estimate for each row in the results.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user