Home / Data Analyst practice test / Analyzing Queries / Question

Databricks Data Analyst Associate · free practice question

A data analyst wants to compare the row counts in a Delta table as they existed one week ago against the counts today to detect unexpected data changes. Which…

Exam-style question on Analyzing Queries from the free Data Analyst practice test, with the answer and a full explanation below.

Updated November 10, 2026

Analyzing Queries

A data analyst wants to compare the row counts in a Delta table as they existed one week ago against the counts today to detect unexpected data changes. Which approach correctly retrieves historical data for comparison?

  1. ARun RESTORE TABLE table_name TO TIMESTAMP AS OF date_sub(current_date(), 7) to open a read-only session snapshot from one week ago, count its rows, and compare; the current table version stays in place
  2. BRun DESCRIBE HISTORY table_name and read the operationMetrics column of the version from seven days ago, which records the total row count of the table at each version, then compare with today
  3. CCopy the table to a staging Delta table with CLONE, then count rows in the original and in the clone; time travel clauses are accepted by CLONE and RESTORE but not inline in a SELECT statement
  4. DRun SELECT COUNT(*) FROM table_name TIMESTAMP AS OF date_sub(current_date(), 7) to read the snapshot from seven days ago, then compare it with the current count; the query leaves the table unchanged
  5. ERun VACUUM table_name RETAIN 168 HOURS to expose the version from seven days ago, then count the rows of that exposed snapshot directly at its cloud storage path and compare with the current count
Answer & explanation

Correct answer: D

WHY D: Delta Lake time travel supports inline SELECT queries with TIMESTAMP AS OF or VERSION AS OF, so the analyst reads historical data in place without altering the table. Running a historical count and a current count and comparing them is the correct, non-destructive approach.

WHY NOT A: RESTORE does not open a temporary snapshot: it rolls the table itself back to the historical version, replacing the current state. That is destructive and wrong for a read-only comparison.

WHY NOT C: CLONE creates a physical copy, which is unnecessary; time travel SELECT queries work natively inline and do not require a clone.

WHY NOT B: operationMetrics records per-operation metadata such as numOutputRows, not a total table row count at each version that could be used for a historical comparison.

WHY NOT E: VACUUM removes old data files and does not expose historical versions; querying a snapshot at a storage path after VACUUM in this way is not valid.

Take the full Data Analyst practice test free →

Would you pass today?

This question is one of 45 in the free, timed Databricks Data Analyst Associate practice test. Take it and get a section-by-section score.

Start the free test →