Section 1 - Instruction

Last time we explored COUNT and SUM for totals. Now let's meet three more aggregate functions: AVG, MIN, and MAX. These help you find averages, smallest values, and largest values.

Together, these five functions handle most data summarization needs you'll encounter.

Engagement Message

What business question might require finding an average value?

Section 2 - Instruction

AVG calculates the arithmetic mean of numeric values. It adds all values and divides by the count, automatically skipping NULL values.

Here's the key detail: AVG may return decimal results even from integer columns. A column of whole numbers can have an average like 4.67.

Suppose you have an orders table like this:

order_idamount
110
215
320

If you run:

The result will be:

avg
15

Engagement Message

If you have order amounts of 10,10, 15, and $20, what's the AVG?

Section 3 - Instruction

MIN finds the smallest value in a column. It works with numbers, dates, and even text (alphabetically first). Perfect for finding lowest prices, earliest dates, or first names alphabetically.

Like other aggregates, MIN ignores NULL values completely.

Suppose your table looks like this:

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal