From the course: From Excel to SQL
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Sorting data
- Save on your query and you have a set of results back from the database. That's great. But the data doesn't really mean much to us yet. One of the ways we can better understand that data, is by sorting it. When it comes to sorting data in an Excel spreadsheet, is pretty simple. You just select a column you want to sort, and then choose how you want to sort it. So, in the employees worksheet, I'll select data and then activate the filters on each column, and then if I want to solve the first name in alphabetical order, I can just click the dropdown option, and sort A to Z, and here we can see that now the names are all sorted alphabetically from A to Z. So how can you sort your results in SQL? Well, all you have to do, is add an ORDER BY clause to your query. Let's take a look at how this works. So, open up DB browser, and let's start with the query, select, first name and last name and t-shirt size…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.