SQLintermediatebackendAI generated

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

  1. 01

    Design the schema

    ~1.5h

    Create accounts, branches, and a transactions table recording transfers between accounts.

  2. 02

    Insert sample transaction data

    ~1.5h

    Populate accounts across branches with a history of deposits, withdrawals, and transfers.

  3. 03

    Compute running balances

    ~2h

    Use a window function to reconstruct each account's running balance over time.

  4. 04

    Detect rapid-transfer patterns

    ~2h

    Write a query flagging accounts with multiple transfers within a short time window.

  5. 05

    Add balance constraints

    ~1h

    Add CHECK constraints preventing account balances from going negative.

  6. 06

    Report branch daily summaries

    ~1.5h

    Write a query summarizing total deposits and withdrawals per branch per day.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~9.5h · 6 steps

Tech stack

PostgreSQLpgAdmin