Complete the code to select all columns from the employees table.
SELECT [1] FROM employees;The asterisk (*) selects all columns from the table.
Complete the code to get only unique department names from the departments table.
SELECT [1] department_name FROM departments;DISTINCT returns unique values, removing duplicates.
Fix the error in the query to order employees by salary descending.
SELECT * FROM employees ORDER BY salary [1];DESC orders results from highest to lowest.
Fill both blanks to select employee names and salaries where salary is greater than 50000.
SELECT employee_name, salary FROM employees WHERE salary [1] [2];
The WHERE clause filters salaries greater than 50000 using > 50000.
Fill all three blanks to create a query that selects department names and counts employees, grouping by department and showing only groups with more than 5 employees.
SELECT [1], COUNT(*) FROM employees GROUP BY [2] HAVING COUNT(*) [3] 5;
We select and group by department_name, then use HAVING with > 5 to filter groups with more than 5 employees.