Utilizor
Contact Us

SQL Functions

Min, Max, Count, Avg, Sum.

SQL Aggregate Functions

SQL has many built-in functions for performing calculations on data.

Aggregate Functions

Aggregate functions return a single value, calculated from values in a column.

  • MIN() - returns the smallest value
  • MAX() - returns the largest value
  • COUNT() - returns the number of rows
  • SUM() - returns the total sum of a numeric column
  • AVG() - returns the average value of a numeric column

MIN() Syntax

SELECT MIN(column_name)
FROM table_name
WHERE condition;

MAX() Syntax

SELECT MAX(column_name)
FROM table_name
WHERE condition;

COUNT(), AVG(), SUM() Syntax

SELECT COUNT(column_name)
FROM table_name
WHERE condition;