Your question is Third Highest Salary in SQL. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
NCR Voyix wants to review compensation levels across teams supporting its retail products. Write a PostgreSQL query to identify employees earning the third-highest distinct salary among active employees in departments belonging to NCR Voyix Retail Solutions.
department_id.NCR Voyix Retail Solutions product area with non-null salaries.Use a window function such as DENSE_RANK, so employees with equal salaries share the same rank and do not create gaps in the distinct salary ranking.
| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee full name |
| department_id | INT | References departments.department_id |
| salary | NUMERIC(12,2) | Annual employee salary |
| employment_status | VARCHAR(20) | Current employment status |
| Column | Type | Description |
|---|---|---|
| department_idPK | INT | Unique department identifier |
| department_name | VARCHAR(100) | Department name |
| product_area | VARCHAR(100) | NCR Voyix product or business area |