*Aggregate functions* in SQL are used to perform computations on a set of values and
return a single value. They are extremely useful when working with large datasets, as they
help you quickly summarize or extract important information.
The most commonly used aggregate functions in SQL are:
- *COUNT()*
- *SUM()*
- *AVG()*
- *MIN()*
- *MAX()*
These functions allow you to perform a variety of calculations, such as counting records,
summing values, and finding the average, minimum, or maximum values in a dataset.
---
*Common Aggregate Functions:*
1. *COUNT()*
The *COUNT()* function returns the number of rows in a table or a selected group of rows.
It is commonly used to count how many records meet a certain condition.
#### Example:
```sql
SELECT COUNT(*) FROM employees;
```
This query counts the total number of rows in the *employees* table.
2. *SUM()*
The *SUM()* function returns the sum of a set of values, typically used for numerical
columns.
#### Example:
```sql
SELECT SUM(salary) FROM employees;
```
This query calculates the total salary of all employees in the *employees* table.
3. *AVG()*
The *AVG()* function returns the average value of a set of values.
#### Example:
```sql
SELECT AVG(salary) FROM employees;