Multi-Branch Bank Transactions Ledger
Design a schema for accounts, branches, and transactions supporting transfers between accounts, then write queries that reconstruct running balances and detect suspicious rapid-transfer patterns. Learners practice window functions, running totals, and transactional integrity constraints.
- Estimate
- ~9.5h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
PostgreSQL · pgAdmin
Project roadmap
- 01
Design the schema
~1.5hCreate accounts, branches, and a transactions table recording transfers between accounts.
- 02
Insert sample transaction data
~1.5hPopulate accounts across branches with a history of deposits, withdrawals, and transfers.
- 03
Compute running balances
~2hUse a window function to reconstruct each account's running balance over time.
- 04
Detect rapid-transfer patterns
~2hWrite a query flagging accounts with multiple transfers within a short time window.
- 05
Add balance constraints
~1hAdd CHECK constraints preventing account balances from going negative.
- 06
Report branch daily summaries
~1.5hWrite a query summarizing total deposits and withdrawals per branch per day.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack