Home›Learn›SQL›MIN and MAX
SQL Master CourseBeginner Friendly

MIN and MAX

Learn how to find minimum and maximum values.

📘 Chapter 24 / 51⏱️ 8–10 Min Read🎯 Beginner Friendly
Course Progress47%

Course Progress

47%

24 / 51 chapters

📖

Theory

Understand the concept step by step

MIN returns the smallest value from a set of values. MAX returns the largest value. They can be used with numeric, date and other comparable data depending on the database system.
💻

Example

See how the concept works in SQL

SQL
SELECT
  MIN(salary) AS minimum_salary,
  MAX(salary) AS maximum_salary
FROM employees;
📤

Output

Understand what the query produces

The query returns the minimum and maximum salary.

📝

Practice

Test your understanding

Find the cheapest and most expensive product.

❓

MCQs

Check your SQL knowledge

What is the main concept covered in MIN and MAX?

A.Smallest and largest values
B.First and last rows only
C.Duplicate values
D.Null values only
💼

Interview Questions

Prepare for SQL interviews

1

Interview Question

What does MIN return?

2

Interview Question

What does MAX return?

3

Interview Question

Can MIN and MAX work with dates?