SQL - GROUP BY and HAVING
You have a students table with columns class and score. You want to find classes where the average score is at least 75 and the number of students is more than 10. Which query achieves this?
You have a students table with columns class and score. You want to find classes where the average score is at least 75 and the number of students is more than 10. Which query achieves this?
GROUP BY class to group rows by class.HAVING AVG(score) >= 75 AND COUNT(*) > 10 to keep classes meeting both conditions.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions