ORDER BY
ORDER BY sorts the result rows by one or more columns:
SELECT name, price FROM products ORDER BY price; -- ascending (default)
SELECT name, price FROM products ORDER BY price DESC; -- descending
ASC= ascending (lowest to highest), it is the default value.DESC= descending (highest to lowest).
It goes at the end of the query, after the WHERE if there is one:
SELECT * FROM products
WHERE price > 20
ORDER BY price DESC;