Lesson 21 of 3266%
(Progress persistence is disabled until Phase 9)
SQL
Beginner
SUM() and AVG()
Calculate totals and averages.
SUM() and AVG()
Calculate totals and averages.
Example
-- Calculate total revenue and average order value
SELECT SUM(total) as TotalRevenue, AVG(total) as AvgOrder FROM orders;
Test it Yourself