Bird
0
0

What does the SQL window function SUM(column) OVER () compute in a query?

easy📝 Conceptual Q11 of 15
SQL - Advanced Window Functions
What does the SQL window function SUM(column) OVER () compute in a query?
AThe maximum value of the column
BThe total sum of the column across all rows without grouping
CThe average of the column values
DThe sum of the column for each group defined by GROUP BY
Step-by-Step Solution
Solution:
  1. Step 1: Understand window function syntax

    The syntax SUM(column) OVER () means sum over all rows without partitioning or grouping.
  2. Step 2: Compare with GROUP BY sum

    Unlike GROUP BY, this sums the entire column across all rows, returning the same total for each row.
  3. Final Answer:

    The total sum of the column across all rows without grouping -> Option B
  4. Quick Check:

    SUM() OVER () = total sum [OK]
Quick Trick: SUM() OVER () gives total sum for all rows, no grouping [OK]
Common Mistakes:
  • Confusing window sum with GROUP BY sum
  • Thinking it calculates average
  • Assuming it returns max value

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes