# Free DDA practice questions

> 10 free DDA practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/databricks-data-analyst/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/databricks-data-analyst/

### Question 1 of 10

Which component of the Databricks platform provides centralized access control, auditing, lineage and data discovery across all workspaces attached to the same metastore?

- A. Photon
- B. Delta Lake
- C. Databricks Marketplace
- D. Unity Catalog

**Answer:** D

**Explanation:** Unity Catalog is the unified governance layer that manages permissions, audit logs, lineage and discovery for data and AI assets across workspaces sharing a metastore. Delta Lake is the open table format that provides ACID transactions and time travel on storage. Photon is the vectorized query engine that speeds up execution. Databricks Marketplace is an exchange for finding and sharing datasets and other data products.

### Question 2 of 10

An analyst runs VACUUM with the default retention on a Delta table, then tries to query a version from three weeks ago with VERSION AS OF and gets an error. What explains this?

- A. VACUUM compacted small files into larger ones, so the old version's file names no longer match the log
- B. VACUUM removed the data files that the old version referenced because they were older than the retention threshold
- C. VACUUM rewrote the transaction log into a single checkpoint file, so all earlier version numbers were renumbered
- D. VACUUM converted the table to an external table, and external tables do not support time travel queries

**Answer:** B

**Explanation:** VACUUM permanently deletes data files no longer referenced by the current table version and older than the retention threshold (seven days by default), so time travel to versions that need those files fails. VACUUM does not renumber versions or rewrite the log into a checkpoint. It does not change a table from managed to external. Compaction is done by OPTIMIZE, and it keeps old files until they are vacuumed.

### Question 3 of 10

New CSV files land daily in a Unity Catalog volume. An analyst wants a SQL statement that loads only files not loaded before into an existing Delta table, so rerunning it does not create duplicates. Which statement fits?

- A. MERGE INTO the table from a temporary view of the path
- B. INSERT INTO ... SELECT * FROM read_files on the path
- C. CREATE OR REPLACE TABLE ... AS SELECT from the path
- D. COPY INTO with the volume path and FILEFORMAT = CSV

**Answer:** D

**Explanation:** COPY INTO tracks which files it has already loaded and skips them on rerun, making incremental, idempotent loads from a path simple. INSERT ... SELECT from read_files reads all files every time and duplicates rows on rerun. CREATE OR REPLACE TABLE rebuilds the whole table rather than appending new files. A MERGE from all files could deduplicate on keys but reads everything each time and needs a key, which is more complex.

### Question 4 of 10 (choose 2)

An analyst needs the running total of daily revenue per store, ordered by date, from a table daily_sales(store_id, sale_date, revenue) that has one row per store per day. Which statements produce this? (Choose two.)

- A. SELECT store_id, sale_date, SUM(revenue) OVER (PARTITION BY store_id ORDER BY sale_date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS running FROM daily_sales
- B. SELECT store_id, sale_date, SUM(revenue) OVER (ORDER BY sale_date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS running FROM daily_sales
- C. SELECT store_id, sale_date, SUM(revenue) OVER (PARTITION BY store_id ORDER BY sale_date) AS running FROM daily_sales
- D. SELECT store_id, sale_date, SUM(revenue) OVER (PARTITION BY store_id) AS running FROM daily_sales
- E. SELECT store_id, sale_date, SUM(revenue) AS running FROM daily_sales GROUP BY store_id, sale_date ORDER BY sale_date

**Answer:** A, C

**Explanation:** A window SUM partitioned by store and ordered by date accumulates from the first row to the current row; with ORDER BY and no explicit frame the default frame already runs from unbounded preceding to the current row, and with one row per store and day both forms match. Without ORDER BY the window returns the store's grand total on every row. GROUP BY returns each day's own total, not a running total. A two-row frame without a partition gives a moving sum across stores.

### Question 5 of 10

A table orders has columns customer_id and order_ts. Which query returns, for each order, the timestamp of the same customer's previous order?

- A. SELECT *, MAX(order_ts) OVER (PARTITION BY customer_id) AS prev_ts FROM orders
- B. SELECT *, LAG(order_ts) OVER (PARTITION BY customer_id ORDER BY order_ts) AS prev_ts FROM orders
- C. SELECT *, LEAD(order_ts) OVER (PARTITION BY customer_id ORDER BY order_ts) AS prev_ts FROM orders
- D. SELECT *, LAG(order_ts) OVER (ORDER BY customer_id, order_ts) AS prev_ts FROM orders GROUP BY customer_id

**Answer:** B

**Explanation:** LAG returns the value from the previous row within the window, so partitioning by customer and ordering by timestamp yields each customer's prior order time. LEAD returns the next order instead. MAX over the whole partition returns the customer's latest order for every row. The last query mixes a GROUP BY with non-aggregated columns and would fail, and without partitioning LAG would cross customer boundaries.

### Question 6 of 10

A query that used to take 20 seconds now takes four minutes. The analyst opens it from query history. Which tool shows how much time each operator spent, how many rows it produced and whether data spilled to disk?

- A. DESCRIBE HISTORY
- B. The query profile
- C. The warehouse monitoring tab
- D. The EXPLAIN statement output

**Answer:** B

**Explanation:** The query profile, opened from query history or the editor, shows the executed plan with per-operator time, row counts, bytes read and spill metrics. DESCRIBE HISTORY lists table versions and operations, not query execution. Warehouse monitoring shows load, running and queued queries and cluster counts, not per-operator detail. EXPLAIN shows the planned operators before execution, without actual timings or spill.

### Question 7 of 10

Viewers of a published dashboard with embedded credentials see revenue for all regions, but the analyst expected each manager to see only their own region based on an existing row filter on the table. What explains this?

- A. Row filters apply only to queries from the SQL editor and are always ignored by AI/BI dashboards
- B. Embedded credentials disable Unity Catalog governance for viewers, so all row filters and column masks are skipped
- C. The dashboard cache was built before the row filter existed and is never invalidated after publishing
- D. With embedded credentials, queries run as the publisher, so the row filter evaluates the publisher's identity

**Answer:** D

**Explanation:** Publishing with embedded credentials executes queries using the publisher's identity, so a row filter based on the current user evaluates for the publisher and returns their visible rows to everyone. Row filters apply to dashboard queries as well. Caching is not the reason here. Governance still applies; it is evaluated for the publisher, which is why publishing without embedded credentials is used when per-viewer filtering is needed.

### Question 8 of 10 (choose 2)

Regional managers must each see only their own region's rows in a dashboard, enforced by an existing row filter that uses current_user(). Which steps are required? (Choose two.)

- A. Duplicate the dashboard once per region with fixed queries
- B. Publish with embedded credentials from an executive account
- C. Ensure managers have USE and SELECT privileges on the data
- D. Publish the dashboard without embedded credentials
- E. Add a region filter widget that defaults to the first region

**Answer:** C, D

**Explanation:** Publishing without embedded credentials runs each viewer's queries with their own identity, so the row filter evaluates per manager, which requires managers to have their own data privileges. Embedded credentials would apply the executive's view to everyone. A filter widget can be changed by viewers and is not a security control. Per-region copies duplicate work and do not use the existing row filter.

### Question 9 of 10

A sales operations team wants business users to ask questions such as 'What were last quarter's top ten products by margin?' in plain English and get answers generated from governed tables. Which Databricks feature is designed for this?

- A. A Databricks SQL alert that runs a query whenever a user sends an email
- B. An AI/BI dashboard with a text filter widget for free-form questions
- C. A Databricks Marketplace listing that exposes the tables to external users
- D. An AI/BI Genie space configured with the relevant sales tables

**Answer:** D

**Explanation:** A Genie space lets users ask natural-language questions that Genie translates into SQL over the tables configured in the space, governed by Unity Catalog. A dashboard filter widget filters existing visualizations but does not interpret free-form questions. Alerts evaluate a fixed query on a schedule and do not respond to user questions. Marketplace shares data products with other organizations and does not answer questions.

### Question 10 of 10

A security team wants to know which users read the table hr.compensation in the last 30 days. Which source provides this MOST directly?

- A. The lineage graph in Catalog Explorer
- B. DESCRIBE HISTORY on the hr.compensation table
- C. SHOW GRANTS ON TABLE hr.compensation
- D. The audit log system table system.access.audit

**Answer:** D

**Explanation:** The system.access.audit system table records Unity Catalog access events, including who accessed which securable and when, and can be queried with SQL. DESCRIBE HISTORY records only write operations on the table. Lineage shows data flow between objects, not a per-user access record. SHOW GRANTS shows who may read the table, not who actually did.

Ready for a timed run? Take the free 15-question DDA mini exam: https://devopscodelab.com/app/exams/databricks-data-analyst/mini/

DevOpsCode Lab is not affiliated with Databricks. DDA and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
