 The students in this module will be continuing with the powerful select command and I mentioned that probably it is the most frequently used command and of course there are many things which are associated with this command which we will be talking about and of course if you recall there is the where clause which is used with the select when we are looking at something very precise exact but that is not the case always right life is imperfect and we are looking for maybe not the exact match to that is pattern matching so I'll talk about in this module how and which command is used to perform pattern matching with the select so let's look at the outline of this module we will look at the limit command the limit command or the clause which limits the number of the rows return and there are many practical reasons why limiting the number of rows return I will explain to you you will understand sort the return rows in any order sometimes you might be interested in ascending order sometime in descending order and so on of course that depends upon the requirement and those requirements are not I repeat they are not effectively and efficiently supported by a text file that is why we have a database and the example of using pattern matching when you are not looking for exact match and there are many many cases when you are not interested in the exact match why because that is not the requirement so let's look into more details limit is the command which specify the range of values so when I say limit 5 limit 6 it means the first 5 starting from the first row return but you can also specify two numbers also for example you can also say 6 comma 7 it means that you start from the sixth row and from that row you count 7 rows so that's one way of doing it why we use the limit command because reducing the data flow between my sequel and PHP you might be thinking that so we have these these results and we should loop through those results and look at what we are interested in right but try to understand that when there is a lot of data okay this this looping is going to consume time looking at that data looking at the data I give you an example for example if you have this example of 1 million results 1 million results okay we have this 1 million results and these results are going to be stored in a variable and assume that there is no where clause okay there is no where clause so all these results they are going to occupy the memory and when the memory is occupied this is just going to grind your application to a halt because so much memory will be consumed okay and to look at something they will be page false with the operating system and they will be accessing the hardest and that is going to be degrade the performance so that is why we need to have this limit command and page such results for example I have this page 1 and page 2 and page 3 and so on up to say page 9 right and for each page say example I have 10 results with this page maybe I'm interesting in this over here so I can click on it and instead of looking at the first 20 results I can go over there that is the strength of the limit command now let's look at the orders to sorting the results right we see that one of the powerful features that really separate databases from text file is the speed and ease with which you can retrieve data in any order imagine you have text file that stores the first and last names that stores the first name and for example you have a list of million book million members you have one million members right so ordered by first name say ordered by a first name over here what are going to happen if you wanted to do list of all the members ordered by last name you'd have to rearrange rearrange for now if you want with this rearrange now rearranging one million is going to be very slow degrade the performance so with sequel retrieving records in a different order is just simply adding the keywords order by adding the keywords order by and that's it order by okay and by default it is ascending order okay it is ascending it is ascending order ASC okay and of course you can you can change it over here DSC in the descending order also remember that order by works faster on a column that has an index because indexes are already sorted in order I believe you understand that indexes are already sorted in order so let's look at retrieval with reference to more interesting results so pattern matching okay now if we are we were using where clause you have looked at being fairly precise although this approach is good if you know the exact column values you're after but it is a bit less specific in your query sometimes you are less specific you are less specific okay and the data is also free form data is also free form okay free form for example like other interest okay and this is not free form is not exact it is not exact right so what you do is that you have this command over here right this is the like so if I say like travel I select travel not either system and also traveling because travel is common over here and when I say not like then this is gone okay there is no travel no travel rating over here no travel rated so I have two over here strings wild card characters wild card wild card characters are here which is the this one and this one this is for any number any number this is exact exact one character okay so using this approach we can retrieve many many records and those are without exact match so that is all I have for this module thank you very much