 Hello welcome back. So see this side and this is continuation of Azure Databricks tutorial. So today we are going to see how we can create the parameters by using the SQL code. So in the last video of this video series we have seen how we can use the Widget utility for creating the parameters. So where we have used the Python code but by using the SQL we can also create parameters. So I would strongly recommend to watch previous video before going forward. Let me quickly go inside the browser and we'll try to implement that in practical. So here the notebook we have already created and default language that we have to select as SQL because we are going to create the parameters by using SQL code. Now here inside the command it's very straightforward. Let me paste the command then I will explain. So this is very straightforward like we can use the create Widget then the type of the parameter that is the drop down then the name of the parameter. So that is the country drop down and then we can see the default. So we can supply the default value and then we can see the choices. So inside the choices we are going to do the union based on these four countries and we are keeping that in a single column and after that we are selecting that column. So this is very straightforward SQL code by which we are combining all those four values and selecting by using this outer query. So we can execute and we will see it should be going to create this parameter and we can go and we can see all these four options are available here. Now next if you want to create any parameter of the type of the combo box then here we can use the combo box and then we can rename this as country CB. Let me try to execute it. We should be able to see two parameters and this is a combo box that we can see and this is the drop down. Now the third type of the parameter that is multi select. So like we can use the same code and instead of combo box we can use the multi select. So simply we can select and here the name that would be country multi select. Let me try to execute it. So it will be going to create one more input parameter that we can see and this is working as multi select. So like these three type of the parameters we have selected and there is no any difference except the type of the parameter and the name. So only these two things we have to update on this query to implement the parameter. But in case of the text parameter remember in the last video we have seen there should not be any choices because inside the text box we cannot create any type of the choices. So we can remove these choices here and default value I am going to call as India and the name that should be txt and the type so that is the text type. Let me try to execute it. So we are able to see we are having these values. Now the actual requirement will be coming because here we can see we are passing the static value of these parameter. So this should not be the static value it should be coming from the table. So the table that is the country master table that we can see and inside the country master table we are having all the values of the locations. So we should be able to see the locations inside the drop down or the combo box or inside the multi select for the choices. So how we can do that. So first we have to make the connection. So I have already recorded one video how we can connect with the SQL server. I am going to use the query here and if you want how we can connect then you can watch that video that is on the part number 11. Now let me try to copy this and let me use it here. Let me execute it. So this query should be going to execute and we are having this DF. So this data frame will be having the PW location table and also verify. So we can use the display command of this data frame. Okay because this cell is referring to SQL. So we can use the magic command. So simply after percentage we can write on which language we want to execute. So here we want to execute in Python. So we have to convert and we should be able to see. So it is having all these locations under this. Now next what we have to do data frame is having all these values. So we have to create the temp view. So that temp view we can access inside the SQL selected statement. Directly data frame cannot be accessed there because it is going to use inside the Python code. You can use the data frame dot and after that it should be having create or replace temp view. And here we can specify the name. So I am going to call this as country and this should be going to execute in the Python. So again I am going to use the magic command as an Python and let me try to execute it. So it should be going to create this temp view. Now remain everything will be same. What we need to do let me try to remove all these input parameter first. So remember in the last video we have seen we can use the db utils dot with get dot remove all. Let me try to execute this. So all your parameters has been gone. Now what we need to do we need to access that temp view that we have created here and we should be able to see all those choices. So instead of getting this from this static value we should be going to see from this country which is a temp view. Let me try to execute it. So it is reflecting an error because remember your column name is the PW location. So you have to use the PW location here. Now let me try to execute it. So here as we can see the drop down is having the Iceland and other all the values we can see in this drop down. So the same thing we can also implement inside the other parameters. So for the multiselect we can simply go and try to use the PW location as the column and the country as the temp view. We can execute and we should be able to see one more input parameter along with all the choices that is available in the table. So this is the way and in the real time you should be able to see this way only. So we are having one of the lookup tables something like that. So we are accessing all those countries from that lookup table and that option should be appearing in the parameter of the notebook. So that's it for this video. See you in the next video.