Course Process
MIN and MAX Function
The MIN() function returns the smallest value of the selected column.
The MAX() function returns the largest value of the selected column.
Syntax:
SELECT MIN(column_name)
FROM table_name
WHERE condition;
SELECT MAX(column_name)
FROM table_name
WHERE condition;
Query 1:
SELECT MIN(salary) FROM `salaries`
Output:
Query 2:
SELECT MAX(salary) FROM `salaries`
Output:
Tester Usage Tips:
- Validate minimum or maximum for numerical columns