Okay. So you've got over a whole bunch of techniques for getting data and filtering it down to what we're looking for. But have you noticed anything? There's no logical order to that data. It's just return in the same order it was entered or captured in the database to begin with. It's not in any numerical order or sorting, ascending or descending according to the alphabet. It's essentially presented in a random order. Well, in this lesson, we're going to bring some order to that chaos by going over the ORDER BY clause to sort out our data. So this is a really simple concept, but as you'll see with most things equal, they're pretty simple concepts, but they're really powerful when you add them together. These little tips and tricks that you use when you're writing your queries or looking at your data, just simple things like being able to sort your data can really help you understand the results and what you're getting back. So after this lesson, you should be able to discuss the importance of sorting data for analysis purposes, explain some of the rules related to using the ORDER BY clause, and actually use the ORDER BY clause to sort data either in ascending or descending order. All right. So, let's begin. So to sort data with SQL, we use the ORDER BY clause. Sorting data in a particular way can be really helpful when viewing data, otherwise, our data could be returned in a manner which makes it a bit more difficult to interpret. Data in tables is not usually consistently ordered as the data can be updated, deleted, or change at any point. A lot of times, you really can't rely on the data being returned in any logical order. So, if you really want to look at your data in a particular order, it's always good to be specific about the order you want it to be in. The other thing is, a lot of times when you're looking at data, you're not going to be able to look at all the records. The other thing is a lot of times when you are looking at data you're not going to be able to look at all the records. Sorting your data in a logical fashion can help you easily look at the information that you want on top. It's really helpful to be specific always about your data that you're retrieving but also, about how you want to do that. ORDER BY allows us to sort data by particular columns. Now there are a few rules when using ORDER BY. One is that it can take multiple column names. You can order by one column or can order by all the columns, and so it goes in the fashion that you want it to add them in. If you're doing multiple columns, you just want to make sure you're adding a comma after that. The other thing is you can actually do is sort by a column that you didn't retrieve. So it may not be in your select statement but you can still use the column to sort your data which is really helpful. The last rule is that ORDER BY must always be the last clause in the select statement. Just kind of on the finishing touches, always round it up with the adding the ORDER BY at the end. So to do this, you can sort by column position. Here at the end of my query, I have order by columns two and three in the table, or you can even just sort it by the actual names of the column. I usually just do the names of the columns, and that keeps things really consistent. If I'm looking at my products table, and sort it by the product names, and then by their unit price, then I would just add that in order by product names, comma unit price. There are also some directions as with any type of sorting, so you can sort it either in ascending, A S C, or descending order, D E S C. And then, this is only applied to the column name it directly proceeds. If you're using order by descending and have unit price, it's not going to do it for all of the columns after the descending. You have to specify each individual columns for ascending and descending, if you want it that way. So again, the idea of ordering is pretty simple concept here. But as you can see, it's really helpful, and just making sure that when you're retrieving your data, you're viewing it how you want to view it, and really just getting to the core of those results. So I highly recommend and encourage you to explore, and use ORDER BY to help you make sense of all the data that you're analyzing.