- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
SQL GROUP BY Quiz
This SQL quiz checks how GROUP BY turns rows into one result row per group. You will predict grouped totals, group by several columns, see how WHERE changes groups and learn which columns are allowed in the SELECT list.
Sample question
Question 1 of 10What does this query return?
CREATE TABLE sales (region TEXT, rep TEXT, amount INTEGER);
INSERT INTO sales VALUES ('North', 'Ana', 100), ('South', 'Ben', 200), ('North', 'Cy', 50), ('South', 'Ana', 70), ('East', 'Dee', 30);
SELECT region, SUM(amount) FROM sales GROUP BY region ORDER BY region;
Show the answer
A. East|30
North|150
South|270 GROUP BY region makes one group per region and SUM(amount) is computed inside each group: North 100 + 50, South 200 + 70, East 30.
What this quiz covers
- One result row per group with
GROUP BY - Aggregates per group like
SUM,COUNTandAVG - Grouping by more than one column
WHEREfilters rows before they are grouped- Which columns can appear in
SELECTnext toGROUP BY
Questions people ask
Do I need an account?
No. Anyone can play. Sign in to keep your XP, streak, badges and history.
Can I retake it?
Yes. Your best score is kept, and the questions and answers are shuffled each time.