Practice Interview Questions
| Question | Status |
|---|---|
You're tasked with finding employees with the highest and lowest salaries. Your output should feature the employee's ID, salary, and department.
Additionally, include a column named 'salary_type' categorizing the results as either 'Highest Salary' or 'Lowest Salary' based on their respective salary rankings.
worker table:
| Column Name | Description |
|---|---|
| worker_id | Identifier of worker |
| first_name | First name |
| last_name | Last name |
| salary | Salary value |
| joining_date | Joining date |
| department | Name of department |
title table:
| Column Name | Description |
|---|---|
| worker_ref_id | Identifier of worker |
| worker_title | Title of worker |
| affected_from | Date of title |
Example output:
| worker_id | salary | department | salary_type |
|---|---|---|---|
| 10 | 65000 | HR | Lowest Salary |
| 4 | 500000 | Admin | Highest Salary |
| 5 | 500000 | Admin | Highest Salary |
You're tasked with finding employees with the highest and lowest salaries. Your output should feature the employee's ID, salary, and department.
Additionally, include a column named 'salary_type' categorizing the results as either 'Highest Salary' or 'Lowest Salary' based on their respective salary rankings.
worker table:
| Column Name | Description |
|---|---|
| worker_id | Identifier of worker |
| first_name | First name |
| last_name | Last name |
| salary | Salary value |
| joining_date | Joining date |
| department | Name of department |
title table:
| Column Name | Description |
|---|---|
| worker_ref_id | Identifier of worker |
| worker_title | Title of worker |
| affected_from | Date of title |
Example output:
| worker_id | salary | department | salary_type |
|---|---|---|---|
| 10 | 65000 | HR | Lowest Salary |
| 4 | 500000 | Admin | Highest Salary |
| 5 | 500000 | Admin | Highest Salary |