Courseiva

Databricks-DA-Assoc · domain

Executing Queries with Databricks SQL

This domain covers writing and tuning SQL in Databricks SQL warehouses: SELECT syntax, joins, aggregations, window functions, and how the Photon engine, Delta Lake, and Unity Catalog affect execution. Questions present query scenarios and ask you to pick the correct clause, diagnose shuffle-heavy plans, or reason about partition pruning and governance.

48 questions10 easy28 medium10 hard

Focused practice

Practice Executing Queries with Databricks SQL questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Executing Queries with Databricks SQL

Be able to read a Databricks SQL query and choose correct clauses, then explain why it is slow or fast. The single most important skill is distinguishing WHERE from HAVING and recognizing when partitioning and Unity Catalog features change execution and access.

Filtering aggregated results with HAVING versus WHERE in Databricks SQL

Diagnosing large shuffles from joins or GROUP BY and applying mitigations

Unity Catalog benefits for Databricks SQL, including governance and access control

Partition pruning on Delta tables partitioned by columns like region and order_date

Watch out for

Common Executing Queries with Databricks SQL exam traps

  • ▸Using WHERE to filter aggregated output instead of HAVING, which fails because aggregates are not yet computed at that stage.
  • ▸Assuming a slow query is always a data-volume problem rather than recognizing shuffle from wide joins or skewed keys.
  • ▸Believing partition columns are pruned automatically regardless of whether the predicate references the partition column directly.

Question index

All Executing Queries with Databricks SQL questions (48)

Click any question to see the full explanation, or start a practice session above.

1

A data analyst runs a query in Databricks SQL that aggregates sales data by product category. The analyst notices that the query results include a category value of NULL. The analyst wants to exclude rows where the category is NULL from the aggregation. Which SQL clause should be added to the query?

Hard
2

Which TWO of the following are benefits of using Unity Catalog with Databricks SQL?

Hard
3

Refer to the exhibit. An analyst receives this error when attempting to select from a table in Databricks SQL. What is the most likely cause?

Easy
4

An analyst is performing a join between a large fact table and a small dimension table. To ensure optimal performance in Databricks SQL, which join type is preferred when the dimension table fits in memory?

Hard
5

An analyst wants to view the query profile for a specific query that was run recently. Where should they look in the Databricks SQL UI?

Medium
6

An analyst is preparing a dashboard and needs to ensure that the queries powering it are as performant as possible. Which THREE techniques should the analyst use to optimize these SQL queries in Databricks?

Hard
7

A data analyst needs to share a frequently updated sales dashboard with business stakeholders who do not have access to the underlying raw tables containing Personally Identifiable Information (PII). Which Databricks SQL feature should be implemented to securely present this summary data?

Medium
8

When querying a Delta table that is updated frequently, what is the most reliable way to ensure an analyst sees the most up-to-date data?

Easy
9

When migrating a reporting workload to Databricks SQL, an analyst needs to ensure that specific query results are consistent across multiple runs, even if the underlying Delta table is being updated. Which feature should the analyst utilize?

Medium
10

A data analyst has a Databricks SQL query that joins a large fact table to a small dimension table. The query is slow because the dimension table is being shuffled across the cluster. The analyst wants to avoid this shuffle and improve performance. Which SQL hint should they use?

Medium
11

Which Databricks SQL object allows an analyst to save a specific query result set and share it with other users, ensuring they see a snapshot of the data at the time of execution?

Easy
12

Which of the following describes the purpose of 'Data Skipping' in Databricks SQL when querying Delta tables?

Medium
13

A data analyst runs a query in Databricks SQL that joins a large fact table to a small dimension table. The query spills to disk and is slow. The analyst adds a /*+ BROADCAST(dim) */ hint to the query. What is the primary effect of this hint on the query execution?

Medium
14

A data analyst is querying a Delta table that is frequently updated with new transactions. The analyst needs to ensure that a report always reflects the most recent committed data, even if a write operation is in progress. Which feature of Delta Lake should the analyst rely on?

Medium
15

A data analyst needs to query a Delta table named sales and retrieve only the rows where the sale_date is in the year 2023. The table is partitioned by sale_date. Which SQL statement will most efficiently return the required data?

Easy
16

Which DDL statement is used to remove a table's data and metadata permanently from the catalog?

Medium
17

An analyst needs to perform a join between a very large table and a small lookup table. Which optimization strategy should the analyst ensure is utilized to maximize performance?

Medium
18

An analyst wants to visualize trends over time using a Databricks SQL dashboard. Which feature should they use to allow end-users to dynamically filter the dashboard data without modifying the underlying SQL queries?

Medium
19

A data analyst is writing a Databricks SQL query that needs to join a large table with a small table and then aggregate the results. To optimize performance, they want to ensure the small table is broadcasted. Which SQL hint syntax should they use in the query?

Medium
20

A data analyst is using Databricks SQL to query a large Delta table. The query is performing slowly because it must scan the entire table to retrieve data for a specific date range. Which action should the analyst take to optimize query performance?

Medium
21

Which THREE of the following are benefits of using the Delta Lake format in Databricks SQL?

Hard
22

An analyst runs a long-running query that fails with an 'Out of Memory' (OOM) error. Which approach is the most effective way to resolve this without changing the underlying data structure?

Medium
23

An analyst needs to query a table that has many small files resulting from frequent streaming ingestions. Which command is most appropriate to consolidate these files into larger, more efficient files for future analytical queries?

Medium
24

Which of the following describes the purpose of 'Query History' in Databricks SQL?

Medium
25

An analyst is running queries on a shared Databricks SQL Warehouse. Which TWO actions improve query performance by reducing the impact of high concurrency?

Medium
26

Which option is recommended to ensure that a SQL Warehouse automatically terminates when no queries are being executed, thereby minimizing unnecessary costs?

Medium
27

You want to create a temporary view that is only available for the duration of the current SQL session. Which command achieves this?

Medium
28

A data analyst is running a complex aggregate query in Databricks SQL that frequently times out before finishing. The underlying Delta table contains hundreds of gigabytes of historical log data partitioned by date. What is the most effective Databricks SQL query optimization technique to apply directly within the SQL statement?

Medium
29

An analyst is using Databricks SQL and wants to optimize query performance for large-scale joins. Which TWO actions should the analyst perform to improve the performance of join operations involving large Delta tables?

Medium
30

A data analyst is exploring a large Delta table named sales in the Databricks SQL query editor. Before writing a detailed report, the analyst wants to quickly view the first 10 rows to understand the column names and data types. Which SQL statement should the analyst execute?

Easy
31

An analyst wants to see the unique values in a column named 'category'. Which SQL command should they use?

Easy
32

Which Databricks SQL feature should an analyst use to view the execution plan and understand the data flow, including the number of rows processed and the time taken at each stage of a query?

Easy
33

Which THREE of the following are valid methods to optimize the performance of a slow-running SQL query in Databricks?

Medium
34

An analyst needs to combine data from two tables that share a common key. Which join type returns all rows from both tables, even if there is no match in the other table?

Medium
35

Refer to the exhibit. An analyst attempts to query table changes using the table changes function (table_changes()) to track incremental updates for a reporting pipeline, but encounters the error shown in the exhibit. How should the analyst resolve this issue?

Hard
36

A data analyst is troubleshooting a slow Databricks SQL query that joins a large fact table with a small dimension table. The query plan shows a broadcast hash join, but the analyst notices that the small table is not being broadcast as expected. Which configuration should the analyst check to ensure the small table is broadcast?

Hard
37

An analyst is preparing a report and needs to ensure that sensitive PII columns are not exposed. Which TWO techniques can be used to achieve this in Databricks SQL?

Medium
38

A data analyst is building a Databricks SQL dashboard that includes a parameter for the region. The dashboard should allow viewers to select a region from a dropdown list that is populated dynamically from the distinct values in the sales table's region column. Which feature should the analyst use to implement this?

Medium
39

You want to perform a case-insensitive search for a string in a column. Which function is most efficient to use for this purpose?

Hard
40

An analyst is observing that a specific query is slow because it performs a large shuffle. Which of the following is the most likely cause, and how can it be mitigated?

Medium
41

Which clause is used in Databricks SQL to filter results after an aggregation has been performed?

Easy
42

An analyst is optimizing query performance in Databricks SQL. Which TWO of the following actions directly improve query execution speed by reducing the amount of data scanned during query execution?

Hard
43

Refer to the exhibit. The table 'sales' is partitioned by 'region' and 'order_date'. How does the Databricks SQL engine process this query to ensure optimal performance?

Medium
44

A data analyst is running a complex, resource-intensive query inside the Databricks SQL query editor that frequently times out before returning results. Which administrative feature should the analyst or workspace admin leverage to manage compute resources and prevent long-running queries from blocking other users?

Medium
45

An analyst is writing a query in the Databricks SQL editor and needs to reference a temporary view that was created earlier in the same interactive session. How are temporary views scoped within Databricks SQL environments?

Easy
46

Which capability is provided by Databricks SQL 'Alerts' when a threshold is triggered?

Hard
47

Which function is used to calculate the average of a column in a SQL query?

Easy
48

Refer to the exhibit. Why might the analyst choose to create a new table with 'AS SELECT *' instead of just running OPTIMIZE on the original table?

Medium

Frequently asked questions

What does the Executing Queries with Databricks SQL domain cover on the Databricks-DA-Assoc exam?
Be able to read a Databricks SQL query and choose correct clauses, then explain why it is slow or fast. The single most important skill is distinguishing WHERE from HAVING and recognizing when partitioning and Unity Catalog features change execution and access.
How many questions are in this domain?
This page lists all 48 Executing Queries with Databricks SQL questions in the Databricks-DA-Assoc question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Executing Queries with Databricks SQL questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
databricks-data-analyst-associate DATABRICKS-DATA-ANALYST-ASSOCIATE executing queries databricks sql Practice Questions