
Answer-first summary for fast verification
Answer: USING CSV
## Explanation In Databricks SQL, when creating a table from external data sources like CSV files, the correct syntax is `USING CSV` to specify the data source format. ### Key Points: 1. **`USING CSV`** is the correct clause to specify that the table should be created using CSV format 2. The `OPTIONS` clause then provides additional configuration for the CSV file (header=true, delimiter="|") 3. The `LOCATION` clause specifies the path to the CSV file 4. **`FROM "path/to/csv"`** is incorrect because `FROM` is used in SELECT queries, not in CREATE TABLE statements 5. **`FROM CSV`** is incorrect syntax for CREATE TABLE 6. **`USING DELTA`** would create a Delta table, not read from a CSV file ### Complete Correct Syntax: ```sql CREATE TABLE new_table USING CSV OPTIONS ( header = "true", delimiter = "|" ) LOCATION "path/to/csv" ``` This creates an external table that references the CSV file at the specified location with the given options.
Author: Keng Suppaseth
Ultimate access to all questions.
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
No comments yet.