databricks Data Analyst Associate · Practice questions

Section 5: Analyzing Queries Practice Questions

Review 10 sample questions with their correct answers and explanations. Sign up free to continue with the full topic quiz.

Sign up free for the full quiz

Question 1

A dashboard query that ran in 2 seconds yesterday now takes 90 seconds. The analyst wants to see which operator consumes the most time and whether data is spilling to disk. What should the analyst use?

  1. The query profile for the run, from query history — Correct
  2. The dashboard's refresh schedule settings
  3. The table's DESCRIBE HISTORY output
  4. The workspace audit log in the account console

Correct answer

The query profile for the run, from query history

Explanation

The query profile shows the execution plan as a graph with time, rows and memory per operator, including spill and data skipping statistics. Query history links to the profile for each run.

Question 2

Which statement about query history in Databricks SQL is correct?

  1. It is only visible to account administrators in the account console
  2. It stores query results permanently so they can be retrieved without re-running
  3. It shows only queries that failed, to support troubleshooting
  4. It lists past queries with status, duration, user and warehouse, linking to profiles — Correct

Correct answer

It lists past queries with status, duration, user and warehouse, linking to profiles

Explanation

Query history lists recent queries with metadata such as user, warehouse, duration and status, and lets users open the query profile to troubleshoot performance.

Question 3

In a query profile, an analyst sees that a scan read 2,000 of 2,000 files even though the WHERE clause filters on a narrow date range. What does this most likely indicate?

  1. The warehouse is undersized, so it reads extra files to balance load
  2. The result cache served the query, so all files were listed
  3. Data skipping failed because data is not organized by date — Correct
  4. Photon is disabled, which forces every query to read all files

Correct answer

Data skipping failed because data is not organized by date

Explanation

Delta uses file-level statistics for data skipping. If rows for the date range are spread across all files, no files can be skipped. Liquid clustering on the date column improves skipping.

Question 4

Which statement about the disk cache (formerly Delta cache) on SQL warehouses is correct?

  1. It stores copies of Delta tables permanently in a second cloud region
  2. It caches remote data files on local node storage to speed up repeated reads — Correct
  3. It is a feature of Delta Sharing that caches data for recipients
  4. It stores the final result set of each query and returns it when the same SQL is run

Correct answer

It caches remote data files on local node storage to speed up repeated reads

Explanation

The disk cache stores remote Parquet/Delta file data on local SSDs of compute nodes, accelerating repeated reads of the same data. The result cache stores query results.

Question 5

An analyst repeatedly runs the same aggregation while developing a dashboard. The underlying table has not changed. Which feature lets the repeated query return quickly without recomputing it on the SQL warehouse?

  1. Automatic liquid clustering
  2. Predictive Optimization
  3. The query result cache — Correct
  4. Delta Change Data Feed

Correct answer

The query result cache

Explanation

Databricks SQL caches query results. If the same query runs again and the underlying data has not changed, results are returned from the cache. Predictive Optimization handles table maintenance, not query results.

Question 6

Which statement about Photon is correct?

  1. Photon is only available on single-node clusters used for interactive notebooks.
  2. Photon only accelerates Python UDFs and has no effect on standard SQL operators.
  3. A vectorized engine that speeds up SQL and DataFrame workloads with no code changes. — Correct
  4. Photon requires queries to be rewritten in Scala to benefit from vectorized execution.

Correct answer

A vectorized engine that speeds up SQL and DataFrame workloads with no code changes.

Explanation

Photon is Databricks' native vectorized engine. It accelerates SQL and DataFrame operations (scans, joins, aggregations, writes) with no code changes and is on by default in SQL warehouses.

Question 7

A single complex query on a SQL warehouse spills to disk and takes a long time, even when no other queries are running. Which change is most likely to help?

  1. Switch the dashboard to a Genie space
  2. Increase the maximum number of clusters
  3. Increase the warehouse's cluster size — Correct
  4. Lower the auto stop timeout

Correct answer

Increase the warehouse's cluster size

Explanation

A larger cluster size gives each query more compute and memory, reducing spill. More clusters improve concurrency but not a single query's resources.

Question 8

Which statement about Photon and query performance is correct?

  1. It helps most on large scans, joins and aggregations, less on tiny queries — Correct
  2. Photon reduces storage costs by compressing tables
  3. Photon always makes every query at least ten times faster
  4. Photon is only useful for streaming workloads

Correct answer

It helps most on large scans, joins and aggregations, less on tiny queries

Explanation

Photon's vectorized execution helps compute-heavy SQL and DataFrame operations most. Small queries dominated by startup or metadata see little gain.

Question 9

An analyst checks a slow query's profile and sees that most time is spent in a scan operator with a high number of bytes read, and 'files pruned' is near zero. What is the best next step?

  1. Rewrite the query to use UNION ALL
  2. Check whether clustering matches the filter columns — Correct
  3. Disable the result cache
  4. Increase the warehouse's maximum clusters

Correct answer

Check whether clustering matches the filter columns

Explanation

Low file pruning means data skipping is ineffective; aligning clustering (or liquid clustering) with common filters reduces bytes read.

Question 10

An analyst runs SELECT COUNT(*) FROM t and the query returns almost instantly even on a very large Delta table. Why?

  1. The cluster skips the query and returns the previous run's value
  2. Delta can answer it from file statistics in the transaction log — Correct
  3. COUNT(*) only counts the first partition
  4. The warehouse returns an estimate from a 1% sample by default

Correct answer

Delta can answer it from file statistics in the transaction log

Explanation

Delta stores row counts and column statistics per file in the transaction log, so simple aggregates like COUNT(*) can often be answered from metadata.

Ready for the full quiz?

Create a free QuizAnalyst account to practice the complete question set and save your progress.

Sign up free for the full quiz