Practice Interview Questions
| Question | Status |
|---|---|
Write a SQL query to find the second highest salary in the engineering department, considering that there may be multiple employees with the same highest salary.
Note: If more than one person shares the highest salary, the query should select the next highest salary.
employees table:
| Column Name | Description |
|---|---|
| id | Unique identifier for each employee |
| first_name | First name of the employee |
| last_name | Last name of the employee |
| salary | Salary of the employee |
| department_id | Identifier for the department |
Write a SQL query to find the second highest salary in the engineering department, considering that there may be multiple employees with the same highest salary.
Note: If more than one person shares the highest salary, the query should select the next highest salary.
employees table:
| Column Name | Description |
|---|---|
| id | Unique identifier for each employee |
| first_name | First name of the employee |
| last_name | Last name of the employee |
| salary | Salary of the employee |
| department_id | Identifier for the department |
departments table:
| Column Name | Description |
|---|---|
| id | Identifier for each department |
| name | Name of the department |
| salary |
|---|
| 2300 |
departments table:
| Column Name | Description |
|---|---|
| id | Identifier for each department |
| name | Name of the department |
| salary |
|---|
| 2300 |