Suggest an editImprove this articleRefine the answer for “How are aggregate functions related to GROUP BY?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Aggregate functions and `GROUP BY` work **as a pair**: aggregate functions (`COUNT`, `SUM`, `AVG`, `MIN`, `MAX`) process several rows and produce one value, while `GROUP BY` splits the table into groups of rows sharing the same values in the chosen columns - `GROUP BY` forms the groups, and the aggregate functions compute a result for each. **Key point:** the example `SELECT department, SUM(salary) FROM employees GROUP BY department` - `GROUP BY` groups rows by department, and `SUM()` computes the salary total **in each department separately**.Shown above the full answer for quick recall.Answer (EN)ImageAggregate functions and `GROUP BY` work **as a pair**. - **Aggregate functions** (`COUNT`, `SUM`, `AVG`, `MIN`, `MAX`) process **several rows and produce one value**. - `GROUP BY` splits the table into groups of rows that share the same values in the chosen columns. When used together: `GROUP BY` forms the groups -> aggregate functions compute a result for each group. ### Example ```sql SELECT department, SUM(salary) FROM employees GROUP BY department; ``` `GROUP BY` forms groups by department, and `SUM()` computes the salary total **in each department separately**.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.