I would like to create a variable that I can use later in multiple sql queries within the same notebook. The variable itself is simply an integer output from a sql statement such as:
select count(people) from persons_table;
Then in subsequent sql command cells, I would simply call the variable in calculations such as:
select (count(cars) / $variable) as car_rate from table_x;
The only variables I've used in Databricks have been simple widgets from a Python script (dbutils.widgets.text('name','value')).
I already have an alternative, where I have a temp table with the output, but would rather use a variable if this is possible.
table_xis the variable, or constant?