MIN and MAX Functions
MIN returns the smallest value, MAX returns the largest. They work on numbers, text, and dates.
Syntax
SELECT MIN(column) FROM table;
SELECT MAX(column) FROM table;
Exercises
Loading exercise...
Loading exercise...
Loading exercise...
Loading exercise...
Loading exercise...
Complete Statistics
Combine all aggregate functions for a complete picture:
Loading exercise...
MIN/MAX with Text
MIN and MAX also work with text (alphabetical order):
- MIN returns the first alphabetically
- MAX returns the last alphabetically
Free Practice
Loading SQL editor...
Try:
- Find the oldest and newest user (by created_at)
- First and last category alphabetically
- Price statistics for a specific category

