Write an SQL query to join two tables and filter the results based on certain conditions.
Asked in the Technical round stage. Using the provided tables, return pending trade requests from active analysts on the Equities or Fixed Income desks, requested during January 2025, with a positive notional amount.
request_id, analyst_name, desk, request_type, and requested_at.requested_at ascending, then request_id ascending.| Column | Type | Description |
|---|---|---|
| analyst_idPK | INT | Unique analyst identifier |
| analyst_name | VARCHAR(100) | Analyst full name |
| desk | VARCHAR(50) | Assigned business desk |
| is_active | BOOLEAN | Whether the analyst is currently active |
| Column | Type | Description |
|---|---|---|
| request_idPK | INT | Unique trade request identifier |
| analyst_id | INT | Analyst submitting the request |
| request_type | VARCHAR(40) | Type of trade request |
| status | VARCHAR(20) | Current request status |
| requested_at | DATE | Date the request was submitted |
| notional_amount | NUMERIC(14,2) | Requested trade notional amount |