×
×
SQL Tutorial
What is SQL SQL SELECT SQL SELECT DISTINCT SQL WHERE SQL INSERT SQL UPDATE SQL DELETE SQL AND, OR & NOT Clause SQL ORDER BY SQL LIKE Clause SQL IN Operator SQL BETWEEN Operator SQL MAX() and MIN() SQL COUNTSQL JOIN
SQL JOIN SQL INNER JOIN SQL LEFT JOIN SQL RIGHT JOIN SQL FULL OUTER JOINSQL MAX() and MIN()
In this tutorial, we'll learn about the MIN() and MAX() functions and how to use them with examples.
- The
MAX()
function returns the maximum value of a column. - The
MIN()
function returns the minimum value of a column.
Example Database:
This is employee table.
id | name | salary | hire date |
---|---|---|---|
1 | Kailash | 20000 | 2022-12-10 |
2 | Amit | 5000 | 2022-07-15 |
3 | Siddarth | 15000 | 2022-03-23 |
4 | Vikas | 30000 | 2022-08-20 |
1. SQL MAX() Function
SELECT MAX(salary)FROM employee;
Result:
id | name | salary | hire date |
---|---|---|---|
4 | Vikas | 30000 | 2022-08-20 |
1 | Kailash | 20000 | 2022-12-10 |
3 | Siddarth | 15000 | 2022-03-23 |
2 | Amit | 5000 | 2022-07-15 |
2. SQL MIN() Function
SELECT MIN(salary)FROM employee;
Result:
id | name | salary | hire date |
---|---|---|---|
2 | Amit | 5000 | 2022-07-15 |
3 | Siddarth | 15000 | 2022-03-23 |
1 | Kailash | 20000 | 2022-12-10 |
4 | Vikas | 30000 | 2022-08-20 |
Elevenstech Web Tutorials
Elevenstech Web Tutorials helps you learn coding skills and enhance your skills you want.
As part of Elevenstech's Blog, Elevenstech Web Tutorials contributes to our mission of “helping people learn coding online”.
Read More
Newsletter
Subscribe to get the latest updates from Elevenstech Web Tutorials and stay up to date
Copyright 2018 - 2025 Elevenstech Web Tutorials All rights reserved.