Complete the code to sort the results by the column 'age' in ascending order.
SELECT * FROM users ORDER BY age [1];Using ASC after ORDER BY sorts the results from smallest to largest (ascending).
Complete the code to sort the results by the column 'salary' in descending order.
SELECT * FROM employees ORDER BY salary [1];Using DESC sorts the results from largest to smallest (descending).
Fix the error in the code to correctly sort by 'date_joined' in descending order.
SELECT * FROM members ORDER BY date_joined [1];The correct keyword to sort descending is DESC. Misspellings cause errors.
Fill both blanks to sort by 'price' ascending and then by 'name' descending.
SELECT * FROM products ORDER BY price [1], name [2];
Use ASC to sort price ascending and DESC to sort name descending.
Fill all three blanks to sort by 'category' ascending, 'stock' descending, and 'rating' ascending.
SELECT * FROM inventory ORDER BY category [1], stock [2], rating [3];
Sort category ascending (ASC), stock descending (DESC), and rating ascending (ASC).