Practice Interview Questions
| Question | Status |
|---|---|
Write a query to to find the names of the employees with the highest and lowest salaries in each department. For this question, let's assume that everyone at the company has different salaries.
employee table:
| Column Name | Description |
|---|---|
| employee_id | Unique identifier for each employee. |
| dep_id | Department identifier for the employee |
| salary | The salary of the employee. |
| employee_name | The name of the employee. |
| max_sal_emp |
|---|
| min_sal_emp |
|---|
| 101 | Alan Smith | John Smith |
| 102 | Tram Dean | Michael Zhou |
Write a query to to find the names of the employees with the highest and lowest salaries in each department. For this question, let's assume that everyone at the company has different salaries.
employee table:
| Column Name | Description |
|---|---|
| employee_id | Unique identifier for each employee. |
| dep_id | Department identifier for the employee |
| salary | The salary of the employee. |
| employee_name | The name of the employee. |
| dep_id | max_sal_emp | min_sal_emp |
|---|---|---|
| 101 | Alan Smith | John Smith |
| 102 | Tram Dean | Michael Zhou |