DDA

Free DDA practice questions

10 questions from our DDA practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.

Back to the DDA practice exams

Question 1 of 10, Understanding of Databricks Data + AI Platform

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

  1. APhoton
  2. BDelta Lake
  3. CDatabricks Marketplace
  4. DUnity Catalog Correct answer

Answer and 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, Managing Data

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?

  1. AVACUUM compacted small files into larger ones, so the old version's file names no longer match the log
  2. BVACUUM removed the data files that the old version referenced because they were older than the retention threshold Correct answer
  3. CVACUUM rewrote the transaction log into a single checkpoint file, so all earlier version numbers were renumbered
  4. DVACUUM converted the table to an external table, and external tables do not support time travel queries

Answer and 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, Importing Data

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?

  1. AMERGE INTO the table from a temporary view of the path
  2. BINSERT INTO ... SELECT * FROM read_files on the path
  3. CCREATE OR REPLACE TABLE ... AS SELECT from the path
  4. DCOPY INTO with the volume path and FILEFORMAT = CSV Correct answer

Answer and 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, Executing Queries Using Databricks SQL and SQL Warehouses. 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.)

  1. ASELECT 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 Correct answer
  2. BSELECT store_id, sale_date, SUM(revenue) OVER (ORDER BY sale_date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS running FROM daily_sales
  3. CSELECT store_id, sale_date, SUM(revenue) OVER (PARTITION BY store_id ORDER BY sale_date) AS running FROM daily_sales Correct answer
  4. DSELECT store_id, sale_date, SUM(revenue) OVER (PARTITION BY store_id) AS running FROM daily_sales
  5. ESELECT store_id, sale_date, SUM(revenue) AS running FROM daily_sales GROUP BY store_id, sale_date ORDER BY sale_date

Answer and 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, Executing Queries Using Databricks SQL and SQL Warehouses

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?

  1. ASELECT *, MAX(order_ts) OVER (PARTITION BY customer_id) AS prev_ts FROM orders
  2. BSELECT *, LAG(order_ts) OVER (PARTITION BY customer_id ORDER BY order_ts) AS prev_ts FROM orders Correct answer
  3. CSELECT *, LEAD(order_ts) OVER (PARTITION BY customer_id ORDER BY order_ts) AS prev_ts FROM orders
  4. DSELECT *, LAG(order_ts) OVER (ORDER BY customer_id, order_ts) AS prev_ts FROM orders GROUP BY customer_id

Answer and 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, Analyzing Queries

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?

  1. ADESCRIBE HISTORY
  2. BThe query profile Correct answer
  3. CThe warehouse monitoring tab
  4. DThe EXPLAIN statement output

Answer and 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, Creating Dashboards and Visualizations

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?

  1. ARow filters apply only to queries from the SQL editor and are always ignored by AI/BI dashboards
  2. BEmbedded credentials disable Unity Catalog governance for viewers, so all row filters and column masks are skipped
  3. CThe dashboard cache was built before the row filter existed and is never invalidated after publishing
  4. DWith embedded credentials, queries run as the publisher, so the row filter evaluates the publisher's identity Correct answer

Answer and 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, Creating Dashboards and Visualizations. 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.)

  1. ADuplicate the dashboard once per region with fixed queries
  2. BPublish with embedded credentials from an executive account
  3. CEnsure managers have USE and SELECT privileges on the data Correct answer
  4. DPublish the dashboard without embedded credentials Correct answer
  5. EAdd a region filter widget that defaults to the first region

Answer and 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, Developing, Sharing, and Maintaining AI/BI Genie Spaces

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?

  1. AA Databricks SQL alert that runs a query whenever a user sends an email
  2. BAn AI/BI dashboard with a text filter widget for free-form questions
  3. CA Databricks Marketplace listing that exposes the tables to external users
  4. DAn AI/BI Genie space configured with the relevant sales tables Correct answer

Answer and 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, Securing Data

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

  1. AThe lineage graph in Catalog Explorer
  2. BDESCRIBE HISTORY on the hr.compensation table
  3. CSHOW GRANTS ON TABLE hr.compensation
  4. DThe audit log system table system.access.audit Correct answer

Answer and 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.