Complete the code to order the results by the column 'age' in ascending order.
SELECT * FROM users ORDER BY [1];The ORDER BY clause sorts the results by the specified column. Here, we want to sort by age.
Complete the code to order the results by 'age' ascending and then by 'name' ascending.
SELECT * FROM users ORDER BY [1], name;To order by multiple columns, list them separated by commas. Here, the first column is age.
Fix the error in the code to order by 'age' ascending and 'name' descending.
SELECT * FROM users ORDER BY age, [1] DESC;The second column to order by is name, and it should be sorted in descending order.
Fill both blanks to order by 'department' ascending and 'salary' descending.
SELECT * FROM employees ORDER BY [1], [2] DESC;
The first column is department ascending, and the second is salary descending.
Fill all three blanks to order by 'country' ascending, 'city' ascending, and 'population' descending.
SELECT * FROM locations ORDER BY [1], [2], [3] DESC;
The columns are ordered by country ascending, then city ascending, and finally population descending.