SQL MIN Tutorial

SQL Tutorial: MIN Function

Learn the basics of the MIN function and how and when to use it in this tutorial.

SQL Bootcamp: Live & Hands-on, In NYC or Online, Learn From Experts, Free Retake, Small Class Sizes,  1-on-1 Bonus Training. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

MIN Function

  • The MIN function is used to find the minimum value of a given column.

  • It retrieves the minimum value of a given column from our data. 

  • Syntax: SELECT MIN(column_1) FROM table ;

Example

Let’s say we have a basketball league and we keep records of each player, which team they are on, and their basic statistics. 

Stats Table

If we wanted to use a SQL query to find the player with the least assists, we would write the following:

SQL MIN statement

Once we hit enter and run, our result should be as follows:

SQL MIN Result

How to Learn SQL

Master SQL with hands-on training. SQL is one of the most in-demand programming languages and is used across a variety of professions.

Yelp Facebook LinkedIn YouTube Twitter Instagram