> For the complete documentation index, see [llms.txt](https://qatesting.gitbook.io/qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qatesting.gitbook.io/qa/database-testing/sql/dml-commands/functions/aggregate-functions.md).

# Aggregate Functions

## **COUNT**&#x20;

The COUNT function returns the number of rows in a group. It counts all values including NULL values.

```sql
SELECT COUNT(column_name) FROM table_name; 
```

## **SUM**

The SUM function returns the total sum of values in a numeric column. It ignores NULL values.

```sql
SELECT SUM(column_name) FROM table_name;
```

## **AVG**&#x20;

The AVG function returns the average value of a numeric column. It ignores NULL values.

```sql
SELECT AVG(column_name) FROM table_name;
```

## **MAX**

The MAX function returns the maximum value in a set of values. It ignores NULL values.

```sql
SELECT MAX(column_name) FROM table_name;
```

## **MIN**&#x20;

The MIN function returns the minimum value in a set of values. It ignores NULL values.

```sql
SELECT MIN(column_name) FROM table_name;
```

## **FIRST**&#x20;

The FIRST function returns the first value in a set of values. It ignores NULL values.

```sql
SELECT FIRST(column_name) FROM table_name; 
```

## **LAST**&#x20;

The LAST function returns the last value in a set of values. It ignores NULL values.

```sql
SELECT LAST(column_name) FROM table_name;
```
