PostgreSQL - Window Functions in PostgreSQL
How can you use
PARTITION BY with ROW_NUMBER() to assign unique row numbers per department but restart numbering for each department, and also order employees by hire date ascending?