3.2 - GROUP BY & HAVING
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
Write an SQL query to count the number of products sold in each category.
💡 Hint: Remember to use GROUP BY after the SELECT statement.
How would you find the total number of orders made by each customer?
💡 Hint: You'll need to aggregate by customer ID.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What clause do you use to group results based on a specific column?
💡 Hint: Think about how you would summarize data.
True or False: The HAVING clause can be used without GROUP BY.
💡 Hint: Remember what HAVING is designed for.
1 more question available
Challenge Problems
Push your limits with advanced challenges
Draft a SQL query that identifies the three products with the highest sales, excluding any product that sold less than 50 units.
💡 Hint: Use GROUP BY and HAVING effectively to filter.
Create a comprehensive report using SQL that highlights customer segments based on their number of purchases, categorizing them as 'Low', 'Medium', or 'High' based on thresholds you define.
💡 Hint: You’ll need to use a CASE statement along with GROUP BY and HAVING.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.