Collections
Datasets
Tools
CSV to SQL
JSON to SQL
My Books
Change password
Log out
Sign In
Use desktop for interactive SQL sandbox
Settings
Fork this book
Notes
SQL
MySQL - 8.0
Oracle - 21.3.0
PostgreSQL - 17
ERD
Run Code
Read-only book
Fork to Edit
Tip: Press
Alt
+
Enter
to run SQL
SQL Output
Clear
2. Second Highest Salary Per Department
Public
Use window functions and DENSE_RANK to find the Nth-ranked value per group while handling ties correctly.
jrz1977
PostgreSQL
Created Jan 23, 2026
Updated Jan 24, 2026
Contents
1
Notes
Notes
2
SQL
SQL
1 SQL
1 Notes
Switch to a SQL tab and press
Alt
+
Enter
to run queries
2. Second Highest Salary Per Department
Updated 1/24/26, 11:25 PM
Notes
SQL
Alt+Enter to run