Databricks-DA-Assoc Analyzing Queries Practice Question
A data analyst writes a complex Spark SQL query involving multiple window functions, CTEs, and aggregations. To debug the query performance, the analyst wants to inspect the logical optimization phases applied by the Catalyst optimizer. Which SQL command can the analyst use to view the unoptimized logical plan, optimized logical plan, and physical execution plan?
⚠ Common exam trap
Candidates often select the 'EXPLAIN' command alone, failing to realize that the basic command only provides the physical plan, omitting the critical logical optimization phases required for debugging complex queries.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
EXPLAIN EXTENDED SELECT ...;
Spark SQL provides the EXPLAIN command to inspect the underlying plans generated by the Catalyst optimizer. By specifying the EXTENDED or FORMATTED modifier, analysts can review parsed logical plans, analyzed logical plans, optimized logical plans, and final physical execution plans.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
DESCRIBE EXTENDED table_name;
Why it's wrong here
The DESCRIBE EXTENDED command provides metadata details about a specific table or view, such as its column names, data types, physical storage location, and partitioning configuration, rather than showing execution plans for arbitrary queries.
- ✗
SHOW QUERY PLAN SELECT ...;
Why it's wrong here
SHOW QUERY PLAN is not a valid SQL syntax command in Apache Spark SQL. Query execution plans are inspected by prepending the EXPLAIN keyword to the query statement rather than using a SHOW command.
- ✓
EXPLAIN EXTENDED SELECT ...;
Why this is correct
Prepending EXPLAIN EXTENDED to a SQL query instructs Spark to output all phases of query planning, including the parsed logical plan, analyzed logical plan, optimized logical plan, and physical execution plan, allowing analysts to thoroughly debug and analyze query behavior.
- ✗
ANALYZE TABLE table_name COMPUTE STATISTICS;
Why it's wrong here
The ANALYZE TABLE command computes and updates table and column statistics in the metastore. While these statistics are essential for the Catalyst optimizer to make sound cost-based decisions, the command itself does not display execution plans.
About these practice questions
Courseiva writes every Databricks-DA-Assoc question from scratch — 291 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-DA-Assoc practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-DA-Assoc exam.