Your question is Second Highest Trade Volume 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.
Apollo Global Management's investment reporting team needs to compare instrument activity across asset classes. Write a PostgreSQL query that finds the second-highest trade volume for each asset class during February 2025.
2025-02-01 through, but not including, 2025-03-01.quantity for each instrument.| Column | Type | Description |
|---|---|---|
| instrument_idPK | INT | Unique instrument identifier |
| instrument_name | VARCHAR(100) | Instrument or fund name |
| asset_class | VARCHAR(50) | Investment asset class |
| Column | Type | Description |
|---|---|---|
| trade_idPK | INT | Unique trade identifier |
| instrument_id | INT | Instrument associated with the trade |
| trade_timestamp | TIMESTAMP | Trade execution timestamp |
| quantity | NUMERIC(18,2) | Number of units traded |