AVG Aggregate
Predict Output Easy
Question
What does this SQL produce?
Code
-- prices: 10, 20, 30
SELECT AVG(price) FROM products;
Hint
AVG calculates the mean: (10+20+30)/3 = 20.
Explanation
AVG(price) calculates the arithmetic mean: (10 + 20 + 30) / 3 = 20. NULL values are ignored in the calculation.
Related Resources
Related Lessons
- Aggregations
Learn aggregations.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.