Bird
0
0

Given a table Sales with columns Region and Amount, what will this query return?

medium📝 query result Q4 of 15
SQL - Aggregate Functions
Given a table Sales with columns Region and Amount, what will this query return?

SELECT Region, SUM(Amount) FROM Sales GROUP BY Region;
AError because GROUP BY is missing columns
BTotal sales amount for each region
CSum of all sales ignoring regions
DList of regions without any totals
Step-by-Step Solution
Solution:
  1. Step 1: Understand GROUP BY usage

    GROUP BY Region groups rows by region to aggregate data per region.
  2. Step 2: Analyze SUM(Amount) with GROUP BY

    SUM(Amount) calculates total sales per each grouped region.
  3. Final Answer:

    Total sales amount for each region -> Option B
  4. Quick Check:

    GROUP BY with SUM() = grouped totals [OK]
Quick Trick: GROUP BY groups rows; aggregation summarizes each group [OK]
Common Mistakes:
MISTAKES
  • Thinking SUM() ignores GROUP BY
  • Expecting a single total without grouping
  • Assuming syntax error without full context

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes