SQL QuestSQL Interview Questions › Date Functions

Pre-1900 Banks

EasyFreeQuerying BasicsDate Functions

Find banks established before 1900 — the legacy institutions. The established_date column is text in MM/DD/YYYY format. Extract the year and filter. Show name, state, established_date. Order by year ascending (oldest first), then by name alphabetically for ties.

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: Pre-1900 chartered US banks

Hint

SQLite: extract the year with SUBSTR(established_date, 7, 4) and CAST it to integer, then filter < 1900. Order by that year ascending, then name ascending — the grader checks order exactly.

Concepts

SELECT WHERE Date Functions ORDER BY

Practise the topic: SQL practice questions · Date function 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

Monthly Order CountEasy · FreeJanuary 2024 OrdersEasy · Free2025 SalesEasy · FreeSpend by Day of WeekEasy · FreeThe Ledger's First Week, Day by DayEasy · FreeEmployee Tenure BandsMedium · 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