Tools
SQL Interview Lab
Runnable practice
Question bank, prompt, editor, output, explanation, and quiz stay visible together.
JOIN
GROUP BY
HAVING
WINDOW
Blog guide
Run SQL
Ctrl+Enter
Prompt
official answer included
Schema Preview
Warm-up Queries
SQL Editor
Reset
SELECT d.name, COUNT(*) AS headcount, ROUND(AVG(e.salary), 2) AS avg_salary FROM employees e JOIN departments d ON d.id = e.dept_id GROUP BY d.id, d.name ORDER BY avg_salary DESC;
SQLite
Output
Results will appear here after you execute...
Explanation
Practice Question
Easy