SQL QuestSQL Interview Questions › Conditional Logic

Asset Tier Classification

EasyFreeQuerying BasicsConditional Logic

Categorize each bank into an asset_tier: 'Mega' if total_assets >= 1,000,000,000 (>$1T), 'Giant' if >= 100,000,000 (>$100B), 'Large' if >= 10,000,000 (>$10B), 'Mid' otherwise. Show name, state, total_assets, asset_tier. Order by total_assets descending. (FDIC reports in thousands.)

Solve it in the browser editor →

Runs on SQLite in your browser, graded against the expected result, no signup. A wrong answer gets a diagnosis, not just "incorrect".

Schema

institutions

certnamecitystatezipcharter_classestablished_datetotal_assetstotal_depositstotal_equityoffice_countbank_class
628JPMorgan Chase Bank, National AssociationColumbusOH43240801/01/1824375266200026978420003359360005335N
3510Bank of America, National AssociationCharlotteNC282021304410/17/1904263682300021019680002462500003840N
7213Citibank, National AssociationSioux FallsSD57108146106/16/181218364360001465300000176530000958N

Expected output: Each bank labeled Mega / Giant / Large / Mid

Hint

CASE WHEN total_assets >= 1000000000 THEN 'Mega' WHEN total_assets >= 100000000 THEN 'Giant' WHEN total_assets >= 10000000 THEN 'Large' ELSE 'Mid' END

Concepts

SELECT CASE

Practise the topic: SQL practice questions · CASE WHEN practice

In these company practice sets

JPMorgan

A SQL Quest challenge matched to patterns reported for these companies — not a question any of them has published.

Related questions

Calculated ColumnsEasy · FreeComp Tier LabelsEasy · FreeMembership Display LabelsEasy · FreeRounded Revenue: Top 10 from 2015+Easy · FreeBuilding Age TierEasy · FreeTool Wear Stress TierEasy · Free

Where would this cost you points in an interview?

Ten questions, no signup: a Skillmap across nine SQL skills and the one to fix first.

Take the readiness test