🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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 →
  1. Q1. Which clause filters GROUPS using an aggregate like COUNT() 3?
  2. Q2. A column has values 10, NULL, 20. What is COUNT(column)?
  3. Q3. In which order does SQL logically process these?
  4. Q4. A column has values 10, NULL, 20. What is AVG(column)?
  5. Q5. Why is SELECT name, COUNT() FROM employees GROUP BY deptid invalid in standard SQL?
  6. Q6. In the company table, what does SELECT SUM(salary) FROM employees WHERE deptid = 20 return?
  7. Q7. SELECT deptid FROM employees GROUP BY deptid on the company table returns how many rows?
  8. Q8. Which query finds departments whose average salary is above 60000?
  9. Q9. Why does SELECT salary 12 AS yearly FROM employees WHERE yearly 600000 fail in standard SQL?
  10. Q10. A column has values 5, NULL, 9, NULL. What is MIN(column)?