#7 most askedVery commonEasyGroup by
Average Salary by Department
New to Group by? Learn it from scratch firstGrouping Results with GROUP BY โ
๐ข Asked in real interviews
No reports yet. Were you asked this? Be the first to say where.Return department and avg_salary (rounded to the nearest whole number) for every department that has employees, highest average first.
๐งช Practice
Write the query, then press Run tests to compare your rows with the expected result.
SELECT * FROM employees;
Output appears here. Press Run or Ctrl/โ + Enter.
Try it first. Struggling for a few minutes is how it sticks.