Write SQL queries using ranking window functions (RANK and DENSE_RANK) together with aggregates, joins and CASE statements
Asked in the SQL technical round stage. This was a 1-hour all-SQL round with two AVPs.
desk_id, desk_name, total_settled_value, settled_trade_count, performance_band, value_rank, and value_dense_rank.SETTLED from 2025-01-01 through 2025-03-31. Rows with a NULL trade value contribute nothing to the total.| Column | Type | Description |
|---|---|---|
| desk_idPK | INT | Unique trading desk identifier |
| desk_name | VARCHAR(60) | Trading desk name |
| Column | Type | Description |
|---|---|---|
| employee_idPK | INT | Unique employee and trader identifier |
| employee_name | VARCHAR(100) | Employee name |
| desk_id | INT | Assigned trading desk identifier |
| Column | Type | Description |
|---|---|---|
| trade_idPK | INT | Unique trade identifier |
| trader_id | INT | Trader identifier |
| trade_date | DATE | Trade execution date |
| status | VARCHAR(40) | Trade processing status |
| trade_value | NUMERIC(14,2) | Monetary value of the trade |