HOW TO USE MIN() AND MAX() FUNTION IN SQL

MIN and MAX IN SQL

MIN() AND MAX()

MIN() function returns the smallest value of the selected column

Syntax –

SELECT  MIN(ColumnName)

FROM <TableName>

WHERE<condition> ;   

Example-

SELECT  MIN(Price)

FROM Products;

MAX() function returns the largest value of the selected column

Syntax –

SELECT  MAX(ColumnName)

FROM <TableName>

WHERE<condition> ;

Example-

SELECT  MAX(Price)

FROM Products;

Note-

Northwind database is used for examples.


Leave a Reply

Your email address will not be published. Required fields are marked *