Lesson 91/100

Tutorials SQL Server Tutorial

Banking Database System — DataVerse Project

Banking Database System — DataVerse Project: free step-by-step lesson with examples, common mistakes, and interview tips — part of SQL Server Tutorial on Toolliyo Academy.

On this page

SQL Server Tutorial · Lesson 91 of 100

Banking Database System

SQL basics ✓Queries ✓Advanced

Advanced · 3 — Procedures · ~10 min · SQL — Real-World Projects

What is this?

A banking project schema centers on customers, accounts, ledgers, and audited transfers with strict constraints and procedures.

Why should you care?

Money systems punish weak keys, missing transactions, and silent overdrafts.

See it live — copy this example

Run in SQL Server Management Studio (SSMS) or Azure Data Studio.

USE DataVerse;
IF OBJECT_ID(N'dbo.LedgerEntries', N'U') IS NOT NULL DROP TABLE dbo.LedgerEntries;
CREATE TABLE dbo.LedgerEntries (
    EntryId BIGINT IDENTITY PRIMARY KEY,
    AccountId INT NOT NULL REFERENCES dbo.Accounts(AccountId),
    Amount DECIMAL(18,2) NOT NULL,
    EntryType CHAR(1) NOT NULL CHECK (EntryType IN ('D','C')),
    CreatedAt DATETIME2 NOT NULL DEFAULT SYSUTCDATETIME()
);
SELECT a.AccountNo, a.Balance, COUNT(l.EntryId) AS Entries
FROM dbo.Accounts a
LEFT JOIN dbo.LedgerEntries l ON l.AccountId = a.AccountId
GROUP BY a.AccountNo, a.Balance;

What happened?

  • LedgerEntries stores each debit/credit.
  • The summary query shows balance plus entry counts — a starting reconciliation view.
  • Pair with usp_TransferFunds from earlier.

Practice next

  1. Create LedgerEntries.
  2. Insert sample D/C rows inside a transfer tran.
  3. Reconcile SUM of entries vs Balance.
  4. Add TxnId UNIQUEIDENTIFIER for correlation.
  5. Build a daily imbalance report query.

Remember

Accounts + ledger entries + transactional procs. Reconcile often. Audit every movement.

DataVerse wallet ledger

Fintech stores every paisa movement in LedgerEntries.

Outcome: Month-end reconcile matches account balances.

Interview prep for this lesson

Practice these questions aloud after reading—each links to a full structured answer.

Mid PDF Detailed
What are the differences between SQL and NoSQL databases?
Short answer: SQL Databases (Relational Databases): These are structured databases that use Structured Query Language (SQL) for defining and manipulating data. Explain a bit more They store data in tables with rows and c…
Mid PDF Detailed
Slower Queries: Fragmented indexes cause the database engine to read more data?
Short answer: pages, slowing down query performance. Real-world example (ShopNest) ShopNest adds an index on Orders(CustomerId, CreatedAt) because “my recent orders” is queried constantly. Say this in the interview Defin…
Junior PDF Detailed
What are the differences between SQL and NoSQL databases?
Short answer: And allow storage of unstructured or semi-structured data. They don't require a fixed schema and are often used for large-scale applications where flexibility, scalability, nd speed are more important than…
Mid PDF Detailed
Shared Database, Shared Schema:?
Short answer: All tenants share the same database and tables. A tenant identifier (e.g., tenant_id) is used to segregate data. Pros: Easier to maintain and scale. Cons: Can lead to security and data isolation issues. Say…
Mid PDF Detailed
Normalize the Database: Apply normalization rules (1NF, 2NF, 3NF) to reduce?
Short answer: redundancy by eliminating unnecessary duplication. Real-world example (ShopNest) Product and Category are separate tables (normalized). The order line stores product id + price snapshot—not a giant duplicat…
Questions on this lesson 0

Sign in to ask a question or upvote helpful answers.

No questions yet — be the first to ask!

SQL Server Tutorial
Course syllabus

SQL Server Tutorial

SQL — Foundations
SQL — SQL Queries & Clauses
SQL — Joins & Relationships
SQL — Indexing & Performance
SQL — Stored Procedures & Functions
SQL — Transactions & Concurrency
SQL — Advanced SQL Server
SQL — Security & High Availability
SQL — 2022 & Cloud
SQL — Real-World Projects
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details