Ad space (banner)
🗄️SQL Lessons
Lesson 35 / 50

Combining MIN, MAX, and AVG

This lesson covers combining MIN, MAX, and AVG in one query to get several statistics at once. It's for anyone searching "SQL MIN MAX AVG tutorial."

MIN() (lowest), MAX() (highest), and AVG() (average) can all appear together in one SELECT. Pairing them with ROUND(value, digits) keeps an average readable instead of a long decimal.

The example computes MIN(score), MAX(score), and ROUND(AVG(score), 1) all in a single SELECT, each labeled with a clear AS alias. Notice how efficient it is to get every statistic you need in one query execution.

A common early mistake is forgetting the second argument (digit count) on ROUND() — skip it, and the average prints as a long, messy decimal instead of a clean display value; rounding for display is something you'll do constantly in practice. Fetching multiple statistics — high, low, average — in one query is exactly what a dashboard or report screen typically needs, and this pattern shows up constantly in grade analysis and similar reporting.

SQL
OUTPUT

💡 The SQL engine may take a few seconds to load the first time you run code.

Ad space (banner)
Ad space (in-article)