Your question is Rank Transactions by Regional Volume. 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.
Write a query using window functions to rank transactions by volume across different regional hubs.
Use the provided hubs and transactions tables. Include only transactions associated with a known hub. Tied transaction volumes must receive the same rank.
transaction_id, hub_name, region, volume, and volume_rank.hub_name, volume_rank, then transaction_id.| Column | Type | Description |
|---|---|---|
| hub_idPK | INT | Unique regional hub identifier |
| hub_name | VARCHAR(100) | Regional hub name |
| region | VARCHAR(50) | Geographic region containing the hub |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| hub_id | INT | Associated regional hub identifier |
| volume | NUMERIC(12,2) | Transaction volume used for ranking |