Welcome to the SQL screen.
The question is on your right: Second-Highest Transaction Amount Query. Read through the requirements and the one table first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
You are given a transaction table from an Infosys Finacle-style payments dataset. Write a PostgreSQL query to return the second-highest distinct transaction amount without using the LIMIT clause. If the highest amount appears multiple times, it should still count as one distinct value, so the query must return the next lower distinct amount.
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| account_id | INT | Account associated with the transaction |
| transaction_type | VARCHAR(20) | Type of transaction |
| amount | DECIMAL(10,2) | Transaction amount |
| transaction_date | DATE | Date of the transaction |