 So student in this module I will be talking about SQL and some of the examples of the select statement which is a very powerful statement in SQL. Now SQL is an acronym for structured query language but over the period of time it has no longer an acronym. When we say SQL people think of the SQL database and when we say SQL database or people think of the SQL database it is a relational model. There are quite a few statements in the SQL which I mentioned in the prior module also. But the kind of good thing is that since they are so powerful statements in a web based database application environment we are good or we are safe or we are in a good position not using all of those statements. We can do quite a lot of things with a very small number of SQL statements. So let's look at those statements also very briefly with definitely the select statement not all of those statements and I will also talk about the performance issue because remember one thing is that if you are if there are multiple customers or multiple people from different domain and they are looking at your website and other website then performance is very important it's not a desktop application all the world is looking at your application. So your application has to not only perform but it has to engage the end user with a waste time which I will explain to you very shortly. So what will be covered in this module basic rule of SQL impact of database driven websites and so on and then I will also talk about cursors and I will talk about sensitive cursors and why all of this is why all this matters why this is important and of course some examples of the select command also the basic rule of SQL this is the same thing which we discussed in the prior modules that everything is a table in the relational model or the SQL database which is the relational model everything is a table and the result of the operator on a table also results in a table. So now let's look at what happens in the traditional programming paradigm in the 80s and 90s and how it is different from the SQL stuck it to language. Now what happened in the 80s and 90s was you can see on the screen that get the first record okay and do something on it whatever the processing is required and loop keep on getting the records one by one and performing actions on them okay till there are no records or certain stop criteria is is reached so that was the 80s and 90s okay in the relational database is that get all records which are so for example if I am interested in finding those people who have been late by two months in their bill payment and they were also late the prior year also so in this SQL domain I will retrieve all the records of the people who who have who have been late by two months and that happened in the previous year also and then I will process on it okay so get all the records okay and then do something on them whatever was required to be done so this is the big difference between the conventional paradigm and the SQL paradigm so now what is the impact of database driven websites is that HTML is generated as per the SQL rule basic SQL rule the basic SQL rule is retrieve all okay what is relevant and then of course we perform the operation on them same rule for single record all the records are retrieved they say for example now I have to put the labels on the web page to create a table that returns one row per unique identifier so I have to ensure that whatever is going to be displayed on the web page that has a unique identifier and all the records which which which meet that criteria as retrieved and then individually select from among those records and that data is then displayed as part of the web page what is the cursor now again we are talking about the performance cursor is a pointer to the process rows right so there is a query the data is retrieved that data is in a cursor I access that cursor now I am not going to details because that is part of the database course but right now why I am mentioning it it will be clear in the next slide so I make that query I have this cursor which is the reference and this cursor when I discuss it requires less database processing it requires less database processing because the data has been retrieved and I can reference it now there's a difference between the cursor which I just mentioned and sensitive cursor so sensitive cursor is that if there are changes in the database corresponding to which I have executed a cursor so in a sensitive cursor those changes are reflected in a sensitive cursor in an insensitive cursor I am not looking at or that those changes are not displayed so that was a difference between the sensitive and insensitive cursor now finally why this matters okay is moving the evaluations into the original query that gives the performance right optimize the query writing optimize the query writing as I just gave the example that instead of bringing out the records of the people who were laid by two payments and then finding if they were late last year also that is going to run slower as compared to bringing all the people with two late payments and last year late also this is optimizing the query writing okay now remember one thing remember that once I am I have I'm retrieving data from the database it is unpredictable unpredictable is the sense that we don't know that how many records will match the condition right now once I have this matching data which is unpredictable then what I can do that I can use a cursor to select the records one by one so it is predictable in the cursor with a ways just retrieving all the records now I have to keep my customer my visitor engaged so I will give a message okay now I am processing kind of a message this data is being processed and then you can retrieve one by one one by one from the cursor incrementally okay which of course will take constant amount of time as compared to running the query on the database and retrieving everything everything with the where clause and now some of the examples of the select statement so now I will conclude this module and this is the structure of the standard select statement and these are some of the examples give me the names of all the customers where the balance is greater than zero okay and order them and by default this is ascending order so that's all I have for you in this module thank you for your time