Tabs to spaces
This commit is contained in:
parent
aec9b05875
commit
b0f23d78a4
@ -46,8 +46,7 @@ SELECT * FROM us_counties_pop_est_2019;
|
|||||||
-- Windows users: Please check the Note on PAGE XXXXXX as well.
|
-- Windows users: Please check the Note on PAGE XXXXXX as well.
|
||||||
|
|
||||||
COPY us_counties_pop_est_2019
|
COPY us_counties_pop_est_2019
|
||||||
-- FROM 'C:\YourDirectory\us_counties_2010.csv'
|
FROM 'C:\YourDirectory\us_counties_pop_est_2019.csv'
|
||||||
FROM '/Users/DeBarrosA/Dropbox (Personal)/DataMonky/Book-Writing/PracticalSQL_2e/Code-Repo/Chapter_05/us_counties_pop_est_2019.csv'
|
|
||||||
WITH (FORMAT CSV, HEADER);
|
WITH (FORMAT CSV, HEADER);
|
||||||
|
|
||||||
-- Checking the data
|
-- Checking the data
|
||||||
@ -80,8 +79,7 @@ CREATE TABLE supervisor_salaries (
|
|||||||
-- Listing 5-5: Importing salaries data from CSV to three table columns
|
-- Listing 5-5: Importing salaries data from CSV to three table columns
|
||||||
|
|
||||||
COPY supervisor_salaries (town, supervisor, salary)
|
COPY supervisor_salaries (town, supervisor, salary)
|
||||||
-- FROM 'C:\YourDirectory\supervisor_salaries.csv'
|
FROM 'C:\YourDirectory\supervisor_salaries.csv'
|
||||||
FROM '/Users/DeBarrosA/Dropbox (Personal)/DataMonky/Book-Writing/PracticalSQL_2e/Code-Repo/Chapter_05/supervisor_salaries.csv'
|
|
||||||
WITH (FORMAT CSV, HEADER);
|
WITH (FORMAT CSV, HEADER);
|
||||||
|
|
||||||
-- Check the data
|
-- Check the data
|
||||||
@ -96,8 +94,7 @@ CREATE TEMPORARY TABLE supervisor_salaries_temp
|
|||||||
(LIKE supervisor_salaries INCLUDING ALL);
|
(LIKE supervisor_salaries INCLUDING ALL);
|
||||||
|
|
||||||
COPY supervisor_salaries_temp (town, supervisor, salary)
|
COPY supervisor_salaries_temp (town, supervisor, salary)
|
||||||
-- FROM 'C:\YourDirectory\supervisor_salaries.csv'
|
FROM 'C:\YourDirectory\supervisor_salaries.csv'
|
||||||
FROM '/Users/DeBarrosA/Dropbox (Personal)/DataMonky/Book-Writing/PracticalSQL_2e/Code-Repo/Chapter_05/supervisor_salaries.csv'
|
|
||||||
WITH (FORMAT CSV, HEADER);
|
WITH (FORMAT CSV, HEADER);
|
||||||
|
|
||||||
INSERT INTO supervisor_salaries (town, county, supervisor, salary)
|
INSERT INTO supervisor_salaries (town, county, supervisor, salary)
|
||||||
@ -113,8 +110,7 @@ SELECT * FROM supervisor_salaries LIMIT 2;
|
|||||||
-- Listing 5-7: Export an entire table with COPY
|
-- Listing 5-7: Export an entire table with COPY
|
||||||
|
|
||||||
COPY us_counties_pop_est_2019
|
COPY us_counties_pop_est_2019
|
||||||
-- TO 'C:\YourDirectory\us_counties_export.txt'
|
TO 'C:\YourDirectory\us_counties_export.txt'
|
||||||
TO '/Users/DeBarrosA/Dropbox (Personal)/DataMonky/Book-Writing/PracticalSQL_2e/Code-Repo/Chapter_05/us_counties_export.txt'
|
|
||||||
WITH (FORMAT CSV, HEADER, DELIMITER '|');
|
WITH (FORMAT CSV, HEADER, DELIMITER '|');
|
||||||
|
|
||||||
|
|
||||||
@ -122,8 +118,7 @@ WITH (FORMAT CSV, HEADER, DELIMITER '|');
|
|||||||
|
|
||||||
COPY us_counties_pop_est_2019
|
COPY us_counties_pop_est_2019
|
||||||
(county_name, internal_point_lat, internal_point_lon)
|
(county_name, internal_point_lat, internal_point_lon)
|
||||||
-- TO 'C:\YourDirectory\us_counties_latlon_export.txt'
|
TO 'C:\YourDirectory\us_counties_latlon_export.txt'
|
||||||
TO '/Users/DeBarrosA/Dropbox (Personal)/DataMonky/Book-Writing/PracticalSQL_2e/Code-Repo/Chapter_05/us_counties_latlon_export.csv'
|
|
||||||
WITH (FORMAT CSV, HEADER, DELIMITER '|');
|
WITH (FORMAT CSV, HEADER, DELIMITER '|');
|
||||||
|
|
||||||
-- Listing 5-9: Exporting query results with COPY
|
-- Listing 5-9: Exporting query results with COPY
|
||||||
@ -133,6 +128,5 @@ COPY (
|
|||||||
FROM us_counties_pop_est_2019
|
FROM us_counties_pop_est_2019
|
||||||
WHERE county_name ILIKE '%mill%'
|
WHERE county_name ILIKE '%mill%'
|
||||||
)
|
)
|
||||||
-- TO 'C:\YourDirectory\us_counties_mill_export.csv'
|
TO 'C:\YourDirectory\us_counties_mill_export.csv'
|
||||||
TO '/Users/DeBarrosA/Dropbox (Personal)/DataMonky/Book-Writing/PracticalSQL_2e/Code-Repo/Chapter_05/us_counties_mill_export.csv'
|
|
||||||
WITH (FORMAT CSV, HEADER);
|
WITH (FORMAT CSV, HEADER);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user