Aggregation & Grouping interview questions

18 real Aggregation & Grouping questions from the SQL bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is GROUP BY?

Junior
  1. A.COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  2. B.groups rows sharing a value so aggregates are computed per group
  3. C.every selected non-aggregated column must also appear in the GROUP BY clause
  4. D.filters groups after aggregation, whereas WHERE filters rows before it
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.GROUP BY — filters groups after aggregation, whereas WHERE filters rows before it
  2. B.GROUP BY — groups rows sharing a value so aggregates are computed per group
  3. C.GROUP BY — COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  4. D.GROUP BY — returns the first non-NULL value from its arguments
Reveal the answer + AI explanation — free account

4. What is HAVING?

Mid
  1. A.groups rows sharing a value so aggregates are computed per group
  2. B.filters groups after aggregation, whereas WHERE filters rows before it
  3. C.aggregate functions returning row count, total, and mean over a group
  4. D.COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.HAVING — aggregate functions returning row count, total, and mean over a group
  2. B.HAVING — COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  3. C.HAVING — every selected non-aggregated column must also appear in the GROUP BY clause
  4. D.HAVING — filters groups after aggregation, whereas WHERE filters rows before it
Reveal the answer + AI explanation — free account

7. What is COUNT / SUM / AVG?

Junior
  1. A.returns the first non-NULL value from its arguments
  2. B.aggregate functions returning row count, total, and mean over a group
  3. C.every selected non-aggregated column must also appear in the GROUP BY clause
  4. D.groups rows sharing a value so aggregates are computed per group
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.COUNT / SUM / AVG — aggregate functions returning row count, total, and mean over a group
  2. B.COUNT / SUM / AVG — every selected non-aggregated column must also appear in the GROUP BY clause
  3. C.COUNT / SUM / AVG — returns the first non-NULL value from its arguments
  4. D.COUNT / SUM / AVG — COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
Reveal the answer + AI explanation — free account

10. What is GROUP BY column rule?

Mid
  1. A.aggregate functions returning row count, total, and mean over a group
  2. B.groups rows sharing a value so aggregates are computed per group
  3. C.COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  4. D.every selected non-aggregated column must also appear in the GROUP BY clause
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.GROUP BY column rule — aggregate functions returning row count, total, and mean over a group
  2. B.GROUP BY column rule — COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  3. C.GROUP BY column rule — returns the first non-NULL value from its arguments
  4. D.GROUP BY column rule — every selected non-aggregated column must also appear in the GROUP BY clause
Reveal the answer + AI explanation — free account

13. What is **COUNT(*) vs COUNT(col)**?

Mid
  1. A.aggregate functions returning row count, total, and mean over a group
  2. B.groups rows sharing a value so aggregates are computed per group
  3. C.COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  4. D.returns the first non-NULL value from its arguments
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.COUNT(*) vs COUNT(col) — returns the first non-NULL value from its arguments
  2. B.COUNT(*) vs COUNT(col) — COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  3. C.COUNT(*) vs COUNT(col) — every selected non-aggregated column must also appear in the GROUP BY clause
  4. D.COUNT(*) vs COUNT(col) — groups rows sharing a value so aggregates are computed per group
Reveal the answer + AI explanation — free account

16. What is COALESCE?

Mid
  1. A.every selected non-aggregated column must also appear in the GROUP BY clause
  2. B.COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  3. C.groups rows sharing a value so aggregates are computed per group
  4. D.returns the first non-NULL value from its arguments
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.COALESCE — COUNT(*) counts all rows; COUNT(col) counts only non-NULL values of that column
  2. B.COALESCE — returns the first non-NULL value from its arguments
  3. C.COALESCE — groups rows sharing a value so aggregates are computed per group
  4. D.COALESCE — every selected non-aggregated column must also appear in the GROUP BY clause
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Aggregation & Grouping free