📖
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?