Bird
0
0

What does the GROUP BY clause do in an SQL query?

easy📝 Conceptual Q11 of 15
SQL - GROUP BY and HAVING
What does the GROUP BY clause do in an SQL query?
AIt deletes duplicate rows from the table.
BIt sorts the rows in ascending order.
CIt groups rows that have the same values in specified columns.
DIt limits the number of rows returned.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of GROUP BY

    The GROUP BY clause collects rows with the same values in specified columns into summary rows.
  2. Step 2: Differentiate from other clauses

    ORDER BY sorts rows, DELETE removes rows, and LIMIT restricts output count, which are different from grouping.
  3. Final Answer:

    It groups rows that have the same values in specified columns. -> Option C
  4. Quick Check:

    GROUP BY = grouping rows [OK]
Quick Trick: GROUP BY groups rows by column values, not sorting [OK]
Common Mistakes:
MISTAKES
  • Confusing GROUP BY with ORDER BY
  • Thinking GROUP BY deletes duplicates
  • Assuming GROUP BY limits rows

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes