Your question is SQL for Bet Customer Segments. 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.
FanDuel Sportsbook wants to identify customers with consistently high win rates. Write a PostgreSQL query that finds customers whose winning bets represent at least 60% of their qualifying settled bets.
status = 'settled' and an outcome of won or lost.| Column | Type | Description |
|---|---|---|
| customer_idPK | INTEGER | Unique FanDuel customer identifier |
| customer_name | VARCHAR(100) | Customer display name |
| Column | Type | Description |
|---|---|---|
| bet_idPK | INTEGER | Unique bet identifier |
| customer_id | INTEGER | Customer who placed the bet |
| status | VARCHAR(20) | Bet status, such as settled or void |
| outcome | VARCHAR(20) | Final result of the bet |