Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Text information
Date and time


That's right. We've already mentioned that one of the reasons for data types is that we can sort information if we know what they are. Let's check that.

SELECT * FROM user_account
ORDER BY nickname;

As you can see, we can sort the results of our SELECT statement by writing ORDER BY followed by the name of the column (or a few columns separated with commas). The default order is ascending (that is, A comes before B). If you want to reverse the order, just put DESC after the name of the column:

FROM user_account
ORDER BY nickname DESC; 


Peter started working on his database and he he now has an impressive number of two columns in his table user_account: columns first_name and nickname.

Let's retrieve all information from the table and sort it according to the values in column first_name in the ascending order.

Stuck? Here's a hint!


FROM user_account
ORDER BY first_name;