Complete the code to load data from a CSV file into the table.
COPY users FROM '[1]' DELIMITER ',' CSV;
The COPY command requires the full path to the CSV file to load data correctly.
Complete the code to specify that the CSV file has a header row.
COPY products FROM '/data/products.csv' DELIMITER ',' CSV [1];
The HEADER option tells PostgreSQL to skip the first row of the CSV file because it contains column names.
Fix the error in the COPY command to load data from a CSV file with tab delimiter.
COPY sales FROM '/data/sales.csv' DELIMITER [1] CSV;
To specify a tab delimiter, use the escape sequence '\t' inside single quotes.
Fill both blanks to load data from a CSV file with semicolon delimiter and skip the header row.
COPY inventory FROM '/data/inventory.csv' DELIMITER [1] CSV [2];
The delimiter for semicolon is ';' in quotes, and HEADER skips the first row.
Fill all three blanks to load data from a CSV file with pipe delimiter, skip header, and specify NULL values as empty strings.
COPY orders FROM '/data/orders.csv' DELIMITER [1] CSV [2] NULL [3];
The pipe character '|' is the delimiter, HEADER skips the first row, and NULL '' treats empty strings as NULL values.