QuestionQ118
Executing queries using Databricks SQL and Databricks SQL WarehousesA data analyst is creating a parameterized SQL query in Databricks to filter sales data by region and year. The analyst wants to test the query using different parameter values before adding it to a dashboard.
Which approach should the analyst use to enable dynamic testing of the parameters in the Databricks SQL editor?
- A Hard-code the region and year values directly into the SQL query and rerun it for each test.
- B Use parameter markers (e.g., :region, :year) in the SQL query and enter their values in the input boxes before running the query.
- C Replace the column names (e.g., region, year) with question marks (“?”) and expect Databricks to prompt for values at runtime.
- D Add the parameters as variables in a Python notebook cell and reference them in the SQL query.
Community Discussion