Tsallaka zuwa abun ciki
Justice Tech School

MIN and MAX

MIN returns the smallest value in a column and MAX the largest. They ignore NULLs and also work on text and dates.

Example
SELECT MIN(score) AS lowest, MAX(score) AS highest
FROM students;

Result

lowest | highest
59     | 92
Example
SELECT MAX(price) AS most_expensive
FROM courses;

Result

most_expensive
15000

Exercise

Find the largest value.

SELECT (score) FROM students;

Quiz Test

What does MIN(score) ignore?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.