Direction: Choose the correct option
Q1.
What are window functions?
Direction: Choose the correct option
Q2.
SELECT name, department, salary, ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) FROM employees;What does PARTITION BY do?Direction: Choose the correct option
Q3.
What's the difference between RANK() and DENSE_RANK()?
Direction: Choose the correct option
Q4.
SELECT order_date, amount, SUM(amount) OVER (ORDER BY order_date) FROM orders;What does this calculate?Direction: Choose the correct option
Q5.
SELECT name, salary, LAG(salary, 1) OVER (ORDER BY salary) FROM employees;What does LAG() do?