Which SQL aggregate function returns the number of rows matching a condition?
- SUM
- AVG
- COUNT
- MAX
Answer: COUNT
COUNT() returns the number of rows that match a specified condition. COUNT(*) counts all rows; COUNT(column) counts non-NULL values. Used with GROUP BY for segmented counts. Other aggregates: SUM (total), AVG (mean), MIN/MAX (extremes). Essential for reporting and analytics queries.