Databricks Data Engineer Associate Question 274
Single answerYou are working with a Delta table named sales_data in Databricks. Your team needs to investigate recent modifications made to this table, including inserts, updates, and deletes. Which statement should you use to retrieve the history of transactions performed on the table?
- A
DESCRIBE HISTORY sales_data
- B
SELECT * FROM history.sales_data
- C
SHOW TRANSACTIONS ON sales_data
- D
DESCRIBE TRANSACTIONS sales_data
Show answer and explanation
Correct answer: A
Explanation
To review a history of table transactions for a Delta table in Databricks, you need to use the DESCRIBE HISTORY command. This command provides comprehensive details about recent changes made to the table, including the type of operation (e.g., update, delete), the user who performed the action, and the timestamp. Other options provided in the question are either invalid or do not apply to Delta tables.
- A. Correct.
This is the correct syntax to retrieve the history of table transactions for a Delta table in Databricks. The
DESCRIBE HISTORYcommand provides details such as operation type, user information, and timestamps. - B. Incorrect.
This is incorrect because there is no
historytable automatically created for Delta tables. The correct command isDESCRIBE HISTORY. - C. Incorrect.
This is incorrect because
SHOW TRANSACTIONS ONis not a valid command in Databricks for viewing Delta table transaction history. - D. Incorrect.
This is incorrect because
DESCRIBE TRANSACTIONSis not a valid command for viewing Delta table transaction history in Databricks.