January 2020
Beginner
256 pages
5h 11m
English
In this lesson, you will learn how to use the SELECT statement’s ORDER BY clause to sort retrieved data as needed.
As you learned in the last lesson, the following SQL statement returns a single column from a database table. But look at the output. The data appears to be displayed in no particular order at all.
Input ▾
SELECT prod_name FROM Products;
Output ▾
prod_name -------------------- Fish bean bag toy Bird bean bag toy Rabbit bean bag toy 8 inch teddy bear 12 inch teddy bear 18 inch teddy bear Raggedy Ann King doll Queen doll
Actually, the retrieved data is not displayed in a mere random order. If unsorted, data will typically be displayed in the order in which it appears in the underlying ...
Read now
Unlock full access