
Answer-first summary for fast verification
Answer: RESTORE TABLE transactions TO VERSION as of 3
The correct method to restore the table to its previous state before the deletion is to use the `RESTORE TABLE` command with the `TO VERSION as of` clause, specifying the version number before the deletion occurred. This command reverts the table to the specified version, effectively undoing the deletion. The syntax and usage are documented in Databricks SQL's RESTORE command documentation, which supports time travel features using either a timestamp or a version number.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You have accidentally deleted records from a table called 'transactions'. The table's version was 3 before the deletion and 4 after. What is the easiest method to restore the deleted records or revert the table to its previous state?
A
RESTORE TABLE transactions FROM VERSION as of 4
B
MINUS
C
RESTORE TABLE transactions TO VERSION as of 3
D
INSERT INTO OVERWRITE transactions SELECT * FROM transactions VERSION AS OF 3
E
SELECT * FROM transactions INSERT INTO OVERWRITE transactions SELECT * FROM transactions VERSION AS OF 4
F
INTERSECT