Databricks Data Analyst Associate · Section 6 · 16% of the exam
Work with parameters in SQL queries and dashboards, including defining, configuring, and testing parameters.
One of the objectives of the Databricks Certified Data Analyst Associate exam, in the section “Working with Dashboards and Visualizations in Databricks”. Here is what it covers, the points to remember and a question to try.
What it covers
Notebooks and the SQL editor share one visualization editor that turns any result into a chart, and the SQL editor can copy a query and its charts into an AI/BI dashboard. Parameters use the same :name marker syntax in the SQL editor, notebooks and dashboards, but each surface defines, tests and exposes them differently.
Points to remember
- In notebooks and the SQL editor, click + above a result and choose Visualization. Notebooks also offer Data Profile.
- Built-in Y aggregations (Sum by default, Average, Count, Count Distinct, Max, Min, Median) apply to the whole result, not only the displayed rows.
- SQL editor Add to dashboard: Create new dashboard or Add to existing dashboard copies the query as a dataset and its visualizations as widgets.
- Named parameter markers (
:name) work in the SQL editor, notebooks, dashboards and Genie. Legacy Mustache{{ }}isn't supported in the new SQL editor or dashboards. - Use
IDENTIFIER(:p)for table or column names. Parameter markers are bound as values, which prevents SQL injection.
Try a question
A dashboard dataset joins a 2-billion-row events table to customers. Viewers almost always look at a single week. With a date range field filter on the dataset, every interaction is slow, because the query joins all events before the filter is applied. Which change most improves performance?
- AReplace the date range filter with cross-filtering from a line chart
- BRepublish with individual data permissions so each viewer gets a separate cache
- CUse a date range parameter inside the dataset query to filter
eventsbefore the join - DAdd the same static widget-level date filter to every visualization on the page
Show the answer
C. Field filters filter the dataset's result: the dashboard wraps the SQL in a CTE and applies the filter at the end, so the join still processes every event. A parameter can be placed anywhere in the query, for example in a subquery on events, so the join reads only one week. The query reruns when the value changes, but it is now far smaller.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Visualizations in Notebooks and the SQL Editor, and Working with Parameters teaches this objective (about 45 minutes), and 10 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Build dashboards using AI/BI Dashboards, including multi-tabs/page layouts, multiple data sources/datasets, and widgets (visualizations, text, images).
- Create visualizations in notebooks and the SQL editor.
- Configure permissions through the UI to share dashboards with workspace users/groups, external users through shareable links, and embed dashboards in external apps.
- Schedule an automatic dashboard refresh.
- Configure an alert with a desired threshold and destination.
- Identify the effective visualization type to communicate insights clearly.