Loading problem...
A billing analytics team wants a quick metric showing how many unique customers have ever produced a high-value bill.
Table: Store
Business rule:
Task: Return a single-row result with one column rich_count containing the number of rich customers.
Output requirements:
Supported submission environments:
Store:
| bill_id | customer_id | amount |
|---------|-------------|--------|
| 6 | 1 | 549 |
| 8 | 1 | 834 |
| 4 | 2 | 394 |
| 11 | 3 | 657 |
| 13 | 3 | 257 |[{"rich_count":2}]Customers 1 and 3 each have at least one bill above 500. Customer 2 does not.
Store:
| bill_id | customer_id | amount |
|---------|-------------|--------|
| 101 | 9 | 500 |
| 102 | 9 | 499 |
| 103 | 10 | 501 |
| 104 | 10 | 500 |
| 105 | 11 | 500 |[{"rich_count":1}]Only customer 10 qualifies because the threshold is strictly greater than 500.
Store:
[][{"rich_count":0}]No bills means no customer can qualify as rich.
Constraints