Bird
0
0

Given the table sales with columns region and amount, what will this query return?

medium📝 query result Q13 of 15
SQL - GROUP BY and HAVING
Given the table sales with columns region and amount, what will this query return?
SELECT region, SUM(amount) FROM sales GROUP BY region;
ASyntax error due to missing WHERE clause
BList of all sales amounts without grouping
CSum of all sales amounts without region breakdown
DTotal sales amount for each region
Step-by-Step Solution
Solution:
  1. Step 1: Understand the query components

    The query groups rows by region and sums amount per group.
  2. Step 2: Predict the output

    It returns one row per region with the total sales amount for that region.
  3. Final Answer:

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

    GROUP BY region + SUM(amount) = total per region [OK]
Quick Trick: GROUP BY + SUM = totals per group [OK]
Common Mistakes:
MISTAKES
  • Thinking it sums all rows ignoring groups
  • Expecting a syntax error without WHERE
  • Confusing grouping with filtering

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes