Complete the code to select all columns from the table named 'employees'.
SELECT [1] FROM employees;The asterisk (*) means select all columns from the table.
Complete the code to select employees with salary greater than 50000.
SELECT name, salary FROM employees WHERE salary [1] 50000;
The '>' operator filters rows where salary is greater than 50000.
Fix the error in the code to order employees by their hire date in ascending order.
SELECT name, hire_date FROM employees ORDER BY hire_date [1];'ASC' means ascending order, which sorts from oldest to newest.
Fill both blanks to group employees by department and count how many are in each.
SELECT [1], COUNT(*) FROM employees GROUP BY [2];
We select the department name and group by department name to count employees per department.
Fill all three blanks to select department names, average salary, and order results by average salary descending.
SELECT [1], AVG([2]) FROM employees GROUP BY [3] ORDER BY AVG(salary) DESC;
We select department_name, calculate average salary, group by department_name, and order by average salary descending.