← All topics
Quiz: GROUP BY and HAVING: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Which clause filters GROUPS using an aggregate like COUNT() 3?
- Q2. A column has values 10, NULL, 20. What is COUNT(column)?
- Q3. In which order does SQL logically process these?
- Q4. A column has values 10, NULL, 20. What is AVG(column)?
- Q5. Why is SELECT name, COUNT() FROM employees GROUP BY deptid invalid in standard SQL?
- Q6. In the company table, what does SELECT SUM(salary) FROM employees WHERE deptid = 20 return?
- Q7. SELECT deptid FROM employees GROUP BY deptid on the company table returns how many rows?
- Q8. Which query finds departments whose average salary is above 60000?
- Q9. Why does SELECT salary 12 AS yearly FROM employees WHERE yearly 600000 fail in standard SQL?
- Q10. A column has values 5, NULL, 9, NULL. What is MIN(column)?