SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Income Band Counts

Unsolved

A bank groups monthly income into three bands: 'Low Salary' for income strictly below 20000, 'Average Salary' for income from 20000 to 50000 inclusive, and 'High Salary' for income strictly above 50000. All three bands must appear in the report, even when a band has no accounts. Write an SQL query that returns category and accounts_count. The rows can be in any order.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
Classic pattern · not tied to a specific company

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM accounts
Full source dataset
6 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine