Predict SUM per Group
Predict Output Medium
Question
Orders for user_id=1 have totals: 10, 20, 30. What is SUM(total) for this group?
Code
SELECT user_id, SUM(total) FROM orders GROUP BY user_id HAVING user_id = 1;
Hint
Sum the totals for user 1.
Explanation
For user_id=1, the totals are 10, 20, 30. SUM = 10 + 20 + 30 = 60.
Related Resources
Related Lessons
- GROUP BY
Learn SUM with GROUP BY.
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.