Other related articles:

Recently viewed articles:

SQL MIN Function

SQL MIN() column functions find the smallest value in a column. The data in the column can contain numeric, string, or date/time information. The SQL MIN function is used to return the minimum value for the values of a column in a group of rows. NULL values are ignored when using the SQL MIN function. The result of the SQL MIN() function has exactly the same data type as the data in the column.

Example:

The following will return minimum salary paid in employee table:

SELECT MIN(salary)
FROM employee;

Output:
MIN SQL 1

Example 2:

The following SQL MIN function finds the oldest employee in the employee table:

SELECT MIN(birth_date)
FROM employee;

Output:
MIN SQL 2

Note: SQL MIN function is used on DATE datatype.

Example 3:

The following SQL MIN function finds the alphabetic min of last name:

SELECT MIN(Last_Name)
 FROM employee;

Output:
MIN SQL 3

Note: SQL MIN function is used on CHARACTER datatype.