Important Interview Questions
1. What is a window function in SQL? How is it different from aggregate functions?
2. Explain the use of the OVER() clause in window functions.
3. What is the purpose of the PARTITION BY clause in window functions?
4. What is the role of the ORDER BY clause in a window function?
5. What is the difference between ROW_NUMBER(), RANK(), and DENSE_RANK() window functions?
6. How do window functions differ from group functions like GROUP BY?
7. Can you use window functions with an ORDER BY clause outside of the OVER() clause? Why or why not?
8. Write a query using the ROW_NUMBER() function to assign sequential numbers to rows in a result set.
9. How does the NTILE() function work in SQL? What is its use case?
10. What is the difference between LAG() and LEAD() window functions?
Hope this helps you 😊
Post #731
2.06K
- 👍 2
- ❤ 1