I am going through an SQL course that tasks me with the exercise of importing data from a CSV file, into an existing SQL database. The syntax has been described to me as follows:
COPY *table_name* FROM '*file path*' DELIMITER "," CSV HEADER;
However, this syntax results in a syntax error every time.
Execution finished with errors.
Result: near "COPY": syntax error
At line 1:
COPY
I guess this course is wrong, as there must be a way to do this and this is not the correct syntax to use. I looked up other possible syntax choices, including COPY INTO
but that also produces an error. What would be the ideal syntax for this function?