AA
A
NovaTech wants a quick salary check from its employee records. Write a SQL query to return the second highest distinct salary from the employees table.
second_highest_salaryNULLemployees
| Column | Type | Description |
|---|---|---|
| employee_id | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| department | VARCHAR(50) | Employee department |
| salary | INT | Employee salary; may contain NULL |
| employee_id | employee_name | department | salary |
|---|---|---|---|
| 104 | Priya Shah | Finance | 95000 |
| 101 | Alice Chen | Engineering | 120000 |
| 109 | Omar Hassan | Support | 0 |
| 103 | Carla Gomez | Engineering | 120000 |
| 106 | Nina Patel | HR | 88000 |
| 102 | Brian Lee | Sales | 99000 |
| 108 | Elena Petrova | Finance | 95000 |
| 105 | David Kim | Marketing | NULL |
| 110 | Grace Liu | Engineering | 135000 |
| 107 | Felix Brown | Sales | -5000 |
| second_highest_salary |
|---|
| 120000 |
Use PostgreSQL-compatible SQL only.
| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| department | VARCHAR(50) | Employee department |
| salary | INT | Employee salary amount |
{"employees":[[104,"Priya Shah","Finance",95000],[101,"Alice Chen","Engineering",120000],[109,"Omar Hassan","Support",0],[103,"Carla Gomez","Engineering",120000],[106,"Nina Patel","HR",88000],[102,"Brian Lee","Sales",99000],[108,"Elena Petrova","Finance",95000],[105,"David Kim","Marketing",null],[110,"Grace Liu","Engineering",135000],[107,"Felix Brown","Sales",-5000],["1","Lucas Walker","null","63"],["2","Isabella Martinez","Training","3"],["3","Felix Brown","Compliance","30"],["4","Charlotte BaOutput[["120000"]]