SQL SELECT MIN MAX Function

MIN() Function

Min function is used to get the minimum value of a column in a table.

Syntax
<?php  

    SELECT MIN(column_name)
	FROM table_name
	WHERE condition;

?>


Example
<?php  

    SELECT MIN(fee) AS LargestFee
	FROM Products;

?>

MAX() Function

Max function is used to get the maximum value of a column in a table.

Syntax
<?php  

    SELECT MAX(column_name)
	FROM table_name
	WHERE condition;

?>


Example
<?php  

    SELECT MAX(fee) AS LargestFee
	FROM student;

?>