Complete the code to sort the results by the column 'age'.
SELECT * FROM employees ORDER BY [1];The ORDER BY clause sorts the results by the specified column. Here, sorting by age orders the employees by their age.
Complete the code to sort the results by 'department' first, then by 'salary'.
SELECT * FROM employees ORDER BY [1], salary;The ORDER BY clause can sort by multiple columns. Here, it sorts first by department, then by salary.
Fix the error in the code to correctly order by 'department' ascending and 'salary' descending.
SELECT * FROM employees ORDER BY department, salary [1];By default, ORDER BY sorts the first column ('department') ascending. To sort the second column ('salary') descending, use DESC.
Fill both blanks to order by 'department' ascending and 'salary' descending.
SELECT * FROM employees ORDER BY department [1], salary [2];
Use ASC for ascending order and DESC for descending order in the ORDER BY clause.
Fill all three blanks to order by 'department' ascending, 'salary' descending, and 'age' ascending.
SELECT * FROM employees ORDER BY [1] [2], salary [3], age;
The ORDER BY clause can sort by multiple columns with different directions. Here, 'department' ascending, 'salary' descending, and 'age' ascending.