From the course: Databricks for Data Analysts
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Parameterized queries for dynamic - Databricks Tutorial
From the course: Databricks for Data Analysts
Parameterized queries for dynamic
Okay, my friends, so that was some basic SQL inside Databricks and now we're going to go to more advanced techniques like, for example, adding parameters inside our queries it is a placeholder you define in your SQL query instead of using hard-coded fixed values which can make your query more interactive and dynamic so now, in order to understand what this means we're going to have the following example, let's go so now we have here a very simple query where we are analyzing the customer's data So we have the customer ID, the country code for each customer and two very simple aggregations. Now by looking to our query, you can see we have column names, table names and some SQL keywords. All those stuff are actually not a fixed static value. So that means there is no need to add any parameters to our query. But now let's go and extend it and change that. Where I would like to create customer segment based on the total spent. So this is going to be very simple using a case when…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.