SUM and AVG Functions
SUM adds up values, and AVG calculates the average. Both work on numeric columns.
Syntax
-- Total of all values
SELECT SUM(column) FROM table;
-- Average of all values
SELECT AVG(column) FROM table;
Exercises
Loading exercise...
Loading exercise...
Loading exercise...
Loading exercise...
Loading exercise...
Calculating Total Value
A common business query is calculating total inventory value (price * quantity):
Loading exercise...
Free Practice
Loading SQL editor...
Try:
- Average stock per product
- Total value of products in a specific category
- Average price of products above a certain price
Up next · Lesson 15 of 27
MIN and MAX Functions
1 min read
14 of 27 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

