Databricks Data Analyst Associate · Section 6 · 16% of the exam
Create visualizations in notebooks and the SQL editor.
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
An analyst wants one SQL editor query to read from whichever of three monthly snapshot tables a user selects, using a :snapshot_table parameter that holds a full three-level table name. SELECT * FROM :snapshot_table fails. How should the FROM clause be written?
- A
FROM ':snapshot_table' - B
FROM {{ snapshot_table }} - C
FROM IDENTIFIER(:snapshot_table) - D
FROM read_files(:snapshot_table)
Show the answer
C. Named parameter markers are bound as values, not pasted into the SQL text, so a marker can't stand where a table name is expected. IDENTIFIER(:snapshot_table) interprets the parameter's string value as an object name. The same pattern works for column names, in notebooks and in dashboard datasets.
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).
- Work with parameters in SQL queries and dashboards, including defining, configuring, and testing parameters.
- 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.