Quick Answer
GROUP BY groups rows with the same value in specified columns into summary rows. Used with aggregate functions (COUNT, SUM, AVG, MAX, MIN). SELECT department, COUNT(*) FROM employees GROUP BY department. Each row in the result represents one group. Columns in SELECT must be either in GROUP BY or inside an aggregate function. HAVING filters groups after aggregation.
Answer
GROUP BY groups rows based on column values and is used with aggregate functions to summarize data.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.