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 filters rows based on a condition.
BIt groups rows that have the same values in specified columns.
CIt deletes duplicate rows from the result.
DIt sorts the rows in ascending order.
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 groups.
  2. Step 2: Compare with other SQL 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 B
  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