What is the usage of the MySQL MIN function?

The MIN() function is used to return the smallest value of a specified column. The syntax is as follows:

SELECT MIN(column_name) FROM table_name;

Suppose we have a table called students, with columns for id and score. If we want to find the student with the lowest score, we can use the following query:

SELECT MIN(score) FROM students;

This will return the minimum value in the score column of the students table.

bannerAds