
Answer-first summary for fast verification
Answer: CREATE OR REPLACE TABLE transactions (transactionId int, transactionDate timestamp, unitsSold int)
The correct command is `CREATE OR REPLACE TABLE transactions (transactionId int, transactionDate timestamp, unitsSold int)`. This command creates a new table or overwrites an existing one with the specified schema. By default, tables in Databricks are stored in Delta format, so there's no need to explicitly specify 'DELTA' in the command.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have been tasked with creating or overwriting an existing Delta table to store transaction data. Which of the following SQL commands correctly accomplishes this?
A
CREATE OR REPLACE DELTA TABLE transactions (transactionId int, transactionDate timestamp, unitsSold int)
B
CREATE OR REPLACE TABLE IF EXISTS transactions (transactionId int, transactionDate timestamp, unitsSold int) FORMAT DELTA
C
CREATE IF EXISTS REPLACE TABLE transactions (transactionId int, transactionDate timestamp, unitsSold int)
D
CREATE OR REPLACE TABLE transactions (transactionId int, transactionDate timestamp, unitsSold int)
No comments yet.