Bird
0
0

Identify the error in this query:

medium📝 Debug Q6 of 15
SQL - Aggregate Functions
Identify the error in this query:
SELECT SUM(Price) FROM Products GROUP BY;
AGROUP BY clause is incomplete without column name
BSUM() cannot be used with GROUP BY
CMissing WHERE clause before GROUP BY
DSUM() requires alias name
Step-by-Step Solution
Solution:
  1. Step 1: Check GROUP BY syntax

    GROUP BY must specify column(s) to group by; empty is invalid.
  2. Step 2: Validate other parts

    SUM() works with GROUP BY; WHERE is optional; alias is optional.
  3. Final Answer:

    GROUP BY clause is incomplete without column name -> Option A
  4. Quick Check:

    GROUP BY needs columns [OK]
Quick Trick: GROUP BY must list columns [OK]
Common Mistakes:
MISTAKES
  • Leaving GROUP BY empty
  • Thinking SUM() disallows GROUP BY
  • Forgetting alias is optional

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes