How to Find the Minimum Value of a Column in SQL Database: SQL PostgreSQL MS SQL Server Oracle MySQL SQLite Operators: MIN Table of Contents Problem: Example: Solution: Discussion: Problem: You’d like to find the smallest numeric value in a column. Example: Our database has a table named employment with data in the following columns: id, first_name, last_name, department, and salary. idfirst_namelast_namedepartmentsalary 1EllieMartinesmarketing1200 2MartinJohnsonfinance2300 3MichaelJacobsproduction1100 4StephenKowalskimarketing4300 5StanleyMillermarketing3500 6JenyBrownfinance5000 7MargaretGreenmarketing1500 8LisaThomasproduction2800 Let’s find the lowest salary among all employees. Solution: SELECT MIN(salary) as min_salary FROM employment; Here’s the result: min_salary 1100 Discussion: To find the minimum value of a column, use the MIN() aggregate function; it takes as its argument the name of the column for which you want to find the minimum value. If you have not specified any other columns in the SELECT clause, the minimum will be calculated for all records in the table. In our example, the query returns the minimum salary among all employees. Of course, since it’s an aggregate function, MIN() can also be used with groups. For example, if we’d like to find the minimum salary for each department, we can write this query: SELECT department, MIN(salary) as min_salary FROM employment GROUP BY department; This query returns the minimum salary for each department: departmentmin_salary marketing1200 finance2300 production1100 Recommended courses: SQL Basics Standard SQL Functions SQL Practice Set Recommended articles: SQL Basics Cheat Sheet SQL MIN and MAX Functions Explained in 6 Examples What Are Aggregate Functions in SQL, and How Do I Use Them? SQL Aggregate Functions Cheat Sheet The SQL MIN() Function Top 9 SQL GROUP BY Interview Questions See also: How to Count Distinct Values in SQL How to Order by Count in SQL? How to Sum Values of a Column in SQL? How to Find Rows with Maximum Value How to Round Numbers in SQL How to Floor Numbers in SQL Subscribe to our newsletter Join our monthly newsletter to be notified about the latest posts. Email address How Do You Write a SELECT Statement in SQL? What Is a Foreign Key in SQL? Enumerate and Explain All the Basic Elements of an SQL Query