Question

Which SQL query would return the top three departments with the highest total salaries from an employees table with columns department , salary , and employee_id ?

A SELECT department, SUM(salary) FROM employees GROUPBY department ORDERBYSUM(salary) DESC LIMIT 3;
B .SELECT department, salary FROM employees WHERE salary =MAX(salary) GROUPBY department LIMIT 3;
C SELECT department, COUNT(salary) FROM employees GROUPBY department HAVINGCOUNT(salary) >3;
D SELECTDISTINCT department, salary FROM employees ORDERBY salary DESC LIMIT 3;
E SELECTdepartment FROM employees GROUPBY department ORDERBYMAX(salary) DESC LIMIT 3;
Practice Next

Hey! Ask a query