Sql, Sql Queries, Big Data, Data Analytics, Data Science.
ROW_NUMBER is assigned based on the salary order within department group. ROW_NUMBER() OVER (PARTITION BY department_id, ORDER BY Salary) BY default ordering done on ascending order, Incase if you want to order desc, then you need to write desc in the ORDER BY clause. i.e. ROW_NUMBER() OVER