You've learned how to create groups with GROUP BY
and filter them with HAVING
. Now it's time to practice combining these powerful clauses to answer more complex business questions.
Engagement Message
Ready to put your grouping and filtering skills to the test?
Type
Fill in the Blanks
Markdown With Blanks
Fill in the blanks to find product categories that have more than 10 products.
Suggested Answers
- GROUP BY
- HAVING
- WHERE
- AND
Type
Multiple Choice
Practice Question
Which query correctly finds departments where the average employee salary is over $75,000?
A. SELECT department, AVG(salary) FROM employees WHERE AVG(salary) > 75000 GROUP BY department; B. SELECT department, AVG(salary) FROM employees GROUP BY department HAVING AVG(salary) > 75000; C. SELECT department, AVG(salary) FROM employees GROUP BY department WHERE salary > 75000; D. SELECT department FROM employees HAVING AVG(salary) > 75000;
Suggested Answers
- A
- B - Correct
- C
- D
Type
Swipe Left or Right
Practice Question
Let's practice distinguishing between WHERE
and . Swipe left for scenarios that need and right for scenarios that need .
