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 filters rows based on a condition.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of GROUP BY

    The GROUP BY clause is used to group rows that share the same values in one or more columns.
  2. Step 2: Differentiate from other clauses

    Sorting is done by ORDER BY, filtering by WHERE, and removing duplicates by DISTINCT, not GROUP BY.
  3. Final Answer:

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

    GROUP BY = groups rows by column values [OK]
Quick Trick: GROUP BY groups rows by column values, not sorting or filtering [OK]
Common Mistakes:
MISTAKES
  • Confusing GROUP BY with ORDER BY
  • Thinking GROUP BY filters rows
  • Assuming GROUP BY removes duplicates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes