Your question is Second-Highest Value Query. 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.
Ahu Technologies wants to identify the second-highest transaction value recorded by its Platform department. Duplicate transaction values must count as one distinct value.
Write a PostgreSQL query that returns the second-highest distinct transaction_value for the department named Platform.
department_id.Platform department.second_highest_transaction_value. Return no rows if fewer than two distinct values exist.| Column | Type | Description |
|---|---|---|
| department_idPK | INTEGER | Unique department identifier |
| department_name | VARCHAR(100) | Department name used for filtering |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INTEGER | Unique transaction identifier |
| department_id | INTEGER | Department associated with the transaction |
| transaction_value | NUMERIC(12,2) | Monetary value of the transaction |