Your question is SQL Min and Max Without Subqueries. Start with the requirements and the one table 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.
GEP's people analytics team needs a quick salary-extremes report for its workforce data. Write a PostgreSQL query to identify every employee whose non-null salary is either the highest or lowest in the employees table, without using subqueries or CTEs.
salary_type label.Highest or Lowest.NULL, and order the result from highest salary to lowest salary.| Column | Type | Description |
|---|---|---|
| employee_idPK | INTEGER | Unique employee identifier |
| employee_name | VARCHAR(100) | Employee's full name |
| department | VARCHAR(80) | GEP department |
| salary | NUMERIC(12,2) | Annual employee salary |