Beginner

385. MIN Function

Learn how to find the minimum value in a dataset.

📘 Lesson 385 of 728 ⏱ 8 min 🎯 Beginner

MIN is an aggregate function that returns the smallest non-NULL value from a set of values.

Finding minimum values helps analysts identify the lowest salary, smallest transaction, earliest date, or lowest price.

Find the lowest employee salary.

SQL
SELECT
    MIN(Salary) AS MinimumSalary
FROM Employees;

MIN is used in pricing analysis, salary analysis, transaction monitoring, date analysis, and operational reporting.

  • MIN returns the smallest value.
  • NULL values are generally ignored.
  • It works with numeric values.
  • It can also work with dates and comparable values.
  • It can be combined with GROUP BY.
What does MIN do?

MIN returns the smallest non-NULL value from the selected expression.

Can MIN work with dates?

Yes. MIN can return the earliest date when used with a date column.

Have you finished this lesson?

Introduction to SQL – All Lessons