0% found this document useful (0 votes)
24 views2 pages

SQL Practice: GROUP BY & Aggregation Queries

Uploaded by

amangamanhwa52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views2 pages

SQL Practice: GROUP BY & Aggregation Queries

Uploaded by

amangamanhwa52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SQL Practice Questions - GROUP BY, ORDER BY,

WHERE, HAVING
1. Find the total salary paid in each department where average salary > 60000, ordered by total
salary.
2. Count employees in each department where performance_score > 80, ordered by count
descending.
3. Find the average bonus per department where total bonus > 30000, ordered by average bonus
descending.
4. Show maximum salary in each department where department is not 'Sales', ordered by max
salary.
5. Show minimum performance score per department where employee count > 3, ordered by min
score.
6. Find departments where total salary > 200000, ordered by employee count.
7. Find departments where maximum bonus > 12000, ordered by maximum salary.
8. Show average performance_score by hire year where average > 75, ordered by hire year.
9. Count employees per hire year where total salary > 100000, ordered by count descending.
10. Find total salary + bonus per department where average salary > 50000, ordered by total
compensation.
11. Show departments where min salary > 40000, ordered by max bonus.
12. List departments where avg bonus > 10000, ordered by avg salary.
13. Find hire years where employees hired > 5, ordered by total performance_score.
14. Show departments where max salary > 90000, ordered by avg bonus descending.
15. Count employees per department where hire_date is after 2018, ordered by count descending.
16. Show departments where avg performance_score > 85, ordered by total salary.
17. List departments with less than 4 employees, ordered by avg salary.
18. Find departments with total bonus > 40000, ordered by employee count descending.
19. Show hire years where min salary > 45000, ordered by avg performance_score.
20. Find departments with max bonus > 15000, ordered by total bonus.
21. List departments where avg salary > 75000, ordered by employee count.
22. Show hire years where max salary > 100000, ordered by max performance_score.
23. Count employees per department where avg performance_score < 80, ordered by count
ascending.
24. Find departments with total salary > 300000, ordered by avg bonus.
25. Show departments where total performance_score > 400, ordered by min salary.
26. List departments with avg bonus > 12000, ordered by max salary descending.
27. Find hire years where avg salary > 70000, ordered by total salary.
28. Show departments with more than 6 employees, ordered by avg performance_score.
29. Find departments where min performance_score > 70, ordered by total salary.
30. Count employees per hire year where avg bonus > 8000, ordered by count descending.
31. Show departments where total salary > 500000, ordered by avg performance_score.
32. Find hire years where avg performance_score > 80, ordered by employee count.
33. Show departments with avg salary > 60000, ordered by max bonus.
34. Find hire years where max bonus > 15000, ordered by avg salary.
35. List departments where avg bonus < 7000, ordered by total salary.
36. Show hire years where min performance_score > 60, ordered by max salary.
37. Find departments with avg salary between 60000 and 90000, ordered by employee count.
38. Show hire years where total bonus > 50000, ordered by avg bonus.
39. Find departments with total performance_score > 500, ordered by total salary.
40. Show hire years with more than 10 employees, ordered by avg salary descending.

You might also like