
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
A data engineer needs to create a table in Databricks using data from a CSV file at location /path/to/csv.
They run the following command:
CREATE TABLE new_table
______
OPTIONS (
header = "true",
delimiter = "|"
)
LOCATION "path/to/csv"
CREATE TABLE new_table
______
OPTIONS (
header = "true",
delimiter = "|"
)
LOCATION "path/to/csv"
Which of the following lines of code fills in the above blank to successfully complete the task?
A
FROM "path/to/csv"
B
USING CSV
C
FROM CSV
D
USING DELTA
Explanation:
In Databricks SQL, when creating a table from an external file format like CSV, the correct syntax is to use USING CSV after the table name and before the OPTIONS clause. This syntax specifies the file format to be used for reading the data.
USING CSV explicitly tells Databricks that the table should be created from CSV format dataOPTIONS clause then provides additional configuration for the CSV reader (like header and delimiter settings)LOCATION clause specifies where the CSV file is storedUSING not FROM for specifying file formatCREATE TABLE new_table
USING CSV
OPTIONS (
header = "true",
delimiter = "|"
)
LOCATION "path/to/csv"
CREATE TABLE new_table
USING CSV
OPTIONS (
header = "true",
delimiter = "|"
)
LOCATION "path/to/csv"
This syntax creates an external table that reads directly from the CSV file at the specified location, using the pipe character as delimiter and treating the first row as header.