Bird
0
0

Why does the PARTITION BY clause inside the OVER clause not reduce the number of rows returned by a query?

hard📝 Conceptual Q10 of 15
SQL - Window Functions Fundamentals
Why does the PARTITION BY clause inside the OVER clause not reduce the number of rows returned by a query?
ABecause PARTITION BY divides rows into groups but does not aggregate or filter rows
BBecause PARTITION BY filters rows before window functions run
CBecause PARTITION BY sorts rows globally
DBecause PARTITION BY removes duplicate rows
Step-by-Step Solution
Solution:
  1. Step 1: Understand the effect of PARTITION BY on rows

    PARTITION BY groups rows logically for window functions but does not remove or filter any rows.
  2. Step 2: Differentiate from filtering or sorting

    Filtering is done by WHERE, sorting by ORDER BY; PARTITION BY only defines groups for calculations.
  3. Final Answer:

    Because PARTITION BY divides rows into groups but does not aggregate or filter rows -> Option A
  4. Quick Check:

    PARTITION BY groups rows, does not reduce row count [OK]
Quick Trick: PARTITION BY groups rows, does not filter or reduce them [OK]
Common Mistakes:
  • Thinking PARTITION BY filters rows
  • Confusing PARTITION BY with GROUP BY
  • Assuming PARTITION BY sorts rows

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes