Write a SQL query to find the top 5 sales reps by closed-won revenue, excluding deals that were discounted by more than 20% at Appzen.
Use the sales_reps and deals tables. Treat a NULL discount as 0% and include only deals with status Closed Won.
rep_name and closed_won_revenue.rep_name ascending as the tie-breaker.| Column | Type | Description |
|---|---|---|
| rep_idPK | INT | Unique sales representative identifier |
| rep_name | VARCHAR(100) | Sales representative name |
| region | VARCHAR(50) | Sales region assigned to the representative |
| Column | Type | Description |
|---|---|---|
| deal_idPK | INT | Unique deal identifier |
| rep_id | INT | Sales representative responsible for the deal |
| status | VARCHAR(30) | Current deal status |
| discount_pct | DECIMAL(5,2) | Discount percentage applied to the deal |
| revenue_amount | DECIMAL(12,2) | Revenue attributed to the deal |