Bird
0
0

Which clause is mandatory to use with NTH_VALUE to specify the order of rows?

easy📝 Conceptual Q2 of 15
SQL - Advanced Window Functions
Which clause is mandatory to use with NTH_VALUE to specify the order of rows?
AWHERE
BORDER BY inside OVER()
CGROUP BY
DHAVING
Step-by-Step Solution
Solution:
  1. Step 1: Identify the role of ORDER BY in window functions

    ORDER BY inside the OVER() clause defines the order of rows for functions like NTH_VALUE.
  2. Step 2: Exclude other clauses

    GROUP BY, WHERE, and HAVING do not control row order within window functions.
  3. Final Answer:

    ORDER BY inside OVER() -> Option B
  4. Quick Check:

    ORDER BY in OVER() = required for NTH_VALUE order [OK]
Quick Trick: Use ORDER BY inside OVER() to define row order [OK]
Common Mistakes:
  • Using GROUP BY instead of ORDER BY for window functions
  • Forgetting ORDER BY inside OVER()
  • Confusing WHERE clause with ordering

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes