Databricks Data Engineer Associate Question 276
Single answerYou are working with a Delta table in Databricks and need to review all the recent operations (such as updates, inserts, and deletes) performed on the table for auditing purposes. Which command will you use to view the history of transactions on the table?
- A
DESCRIBE HISTORY <table_name>
- B
SHOW TRANSACTIONS <table_name>
- C
DESCRIBE DETAIL <table_name>
- D
SELECT * FROM <table_name> WHERE operation = 'history'
Show answer and explanation
Correct answer: A
Explanation
The DESCRIBE HISTORY command in Databricks is specifically designed to retrieve the history of transactions performed on a Delta table. It provides valuable information about operations such as updates, inserts, and deletes, as well as user and timestamp details. This makes it the correct choice for auditing table changes.
- A. Correct.
Correct - The DESCRIBE HISTORY command is used to view the history of table transactions in Delta tables, including details like operation type, user, and timestamp.
- B. Incorrect.
Incorrect - SHOW TRANSACTIONS is not a valid Databricks SQL command for reviewing Delta table history.
- C. Incorrect.
Incorrect - DESCRIBE DETAIL provides metadata about a Delta table such as table size, number of files, and min/max timestamps, but it does not show transaction history.
- D. Incorrect.
Incorrect - SELECT queries will not provide transaction history unless the table is specifically designed to store such information in its content.