Write a SQL query to find the top 5% of users by transaction volume over a rolling 30-day window. Use the latest transaction date as the window end date, and include users with no qualifying transactions as having zero volume. Include ties only when they fall within the top 5% cutoff.
user_id, user_name, window_end_date, transaction_volume, and user_ranktransaction_volume descending and user_id ascending| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique user identifier |
| user_name | VARCHAR(100) | User display name |
| Column | Type | Description |
|---|---|---|
| transaction_idPK | INT | Unique transaction identifier |
| user_id | INT | User associated with the transaction |
| transaction_date | DATE | Transaction posting date |
| amount | DECIMAL(12,2) | Transaction amount |