Interview Question

What are aggregate functions?

Aggregate functions summarize sets of rows.

💡 Concept ✅ Quick Revision 🗃️ SQL

Answer

Aggregate functions calculate one result from a set of input rows. • Common aggregates include COUNT, SUM, AVG, MIN, and MAX. • They can operate over the whole filtered result or once per GROUP BY group. • Most aggregates ignore null input values, while COUNT(*) counts rows.

💡 SQL Example

SELECT department_id, AVG(salary) FROM employees GROUP BY department_id;

Result

10 | 57500.00

⚡ Quick Revision

Aggregate functions summarize sets of rows.