101
0/304
Loading content...
A retail banking analytics team needs a compact monthly distribution report that groups accounts by income tier.
Table: Accounts
Income tier rules:
Task: Return the number of accounts that fall into each income tier.
Output requirements:
Supported submission environments:
Accounts:
| account_id | income |
|------------|--------|
| 3 | 108939 |
| 2 | 12747 |
| 8 | 87709 |
| 6 | 91796 |[
{"category":"Low Salary","accounts_count":1},
{"category":"Average Salary","accounts_count":0},
{"category":"High Salary","accounts_count":3}
]Only account 2 is below 20000, none are in the inclusive [20000, 50000] band, and the remaining three accounts are above 50000.
Accounts:
| account_id | income |
|------------|--------|
| 11 | 20000 |
| 12 | 50000 |
| 13 | 19999 |
| 14 | 50001 |
| 15 | 32000 |[
{"category":"Low Salary","accounts_count":1},
{"category":"Average Salary","accounts_count":3},
{"category":"High Salary","accounts_count":1}
]Boundary values 20000 and 50000 belong to Average Salary. Value 19999 is Low Salary and 50001 is High Salary.
Accounts:
| account_id | income |
|------------|--------|
| (no rows) |[
{"category":"Low Salary","accounts_count":0},
{"category":"Average Salary","accounts_count":0},
{"category":"High Salary","accounts_count":0}
]Even with no accounts, all three categories must be present with zero counts.
Constraints