Learn how the ORDER BY clause provides tools for returning results in order and how you can order your query results by the values of one or more columns.
- [Narrator] If you've been following…the lessons in sequence, you've seen me use the…ORDER BY clause to sort the results of queries.…And here's how it works:…we'll select the world database for this,…and I'm going to enter a simple select statement:…SELECT name FROM Country.…And when I press go, you'll notice…we get the names of the countries,…and they're not in any particular order.…So if I want them in order, I can say ORDER BY…and give the name of the column that I want to order by,…which is Name in this case.…
And now, they are in alphabetical order…according to the ASCII character set.…If I want them in order by name,…but descending rather than ascending;…I can say DESC, and now they'll be in descending order.…The default is ascending order,…or you can enter it ASC if you want to be specific.…And now they're in ascending order.…You can order by a combination of columns if you like.…
I can say, SELECT Name, comma Continent,…and I can order by continent and name.…And this will sort them by continent first,…and within continent, by name.…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.