TGViewer
SQL Programming Resources SQL Programming Resources @sqlanalyst ยท 76.7K subscribers
Post #2675 2.44K
๐Ÿ“ˆ Total Customers 
๐Ÿ“ˆ Active Customers 
๐Ÿ“ˆ Active Accounts 
๐Ÿ“ˆ Total Deposits 
๐Ÿ“ˆ Total Withdrawals 
๐Ÿ“ˆ Net Transaction Value 
๐Ÿ“ˆ Average Transaction Value 
๐Ÿ“ˆ Transaction Volume 
๐Ÿ“ˆ Customer Average Balance 
๐Ÿ“ˆ Total Deposits by Branch 
๐Ÿ“ˆ Branch-wise Transaction Volume 
๐Ÿ“ˆ Customer Segment Analysis 
๐Ÿ“ˆ Premium Customer Contribution 
๐Ÿ“ˆ High-Value Customers 
๐Ÿ“ˆ Monthly Transaction Growth 
๐Ÿ“ˆ Account Growth 
๐Ÿ“ˆ Loan Portfolio Value 
๐Ÿ“ˆ Average Loan Amount 
๐Ÿ“ˆ Loan Distribution by Type 
๐Ÿ“ˆ Active vs Closed Loans 
๐Ÿ“ˆ Customer Loan Exposure 
๐Ÿ“ˆ Deposit-to-Withdrawal Ratio 
๐Ÿ“ˆ Transaction Success Rate 
๐Ÿ“ˆ Dormant Account Analysis 
๐Ÿ“ˆ Unusual Transaction Detection 
๐Ÿ“ˆ Customer Profitability 
๐Ÿ“ˆ Executive Banking Dashboard 

๐Ÿ’ก Example 1: Total Deposits 
SELECT SUM(amount) AS total_deposits 
FROM transactions 
WHERE transaction_type = 'Deposit' AND transaction_status = 'Success'; 

๐Ÿ’ก Example 2: Customer Transaction Summary 
SELECT c.customer_id, c.customer_name, COUNT(t.transaction_id) AS total_transactions, SUM(t.amount) AS total_transaction_value 
FROM customers c 
JOIN accounts a ON c.customer_id = a.customer_id 
JOIN transactions t ON a.account_id = t.account_id 
WHERE t.transaction_status = 'Success' 
GROUP BY c.customer_id, c.customer_name 
ORDER BY total_transaction_value DESC; 

๐Ÿ’ก Example 3: Branch-wise Deposits 
SELECT b.branch_name, SUM(t.amount) AS total_deposits 
FROM branches b 
JOIN accounts a ON b.branch_id = a.branch_id 
JOIN transactions t ON a.account_id = t.account_id 
WHERE t.transaction_type = 'Deposit' AND t.transaction_status = 'Success' 
GROUP BY b.branch_name 
ORDER BY total_deposits DESC; 

๐Ÿ’ก Example 4: Identify High-Value Customers 
SELECT c.customer_id, c.customer_name, SUM(a.current_balance) AS total_balance 
FROM customers c 
JOIN accounts a ON c.customer_id = a.customer_id 
GROUP BY c.customer_id, c.customer_name 
HAVING SUM(a.current_balance) > 500000 
ORDER BY total_balance DESC; 

๐Ÿ’ก Example 5: Monthly Transaction Trend 
SELECT DATE_TRUNC('month', transaction_date) AS month, COUNT(*) AS transaction_count, SUM(amount) AS transaction_value 
FROM transactions 
WHERE transaction_status = 'Success' 
GROUP BY DATE_TRUNC('month', transaction_date) 
ORDER BY month; 

๐Ÿ’ก Example 6: Rank Customers by Balance 
SELECT c.customer_name, SUM(a.current_balance) AS total_balance, DENSE_RANK() OVER (ORDER BY SUM(a.current_balance) DESC) AS balance_rank 
FROM customers c 
JOIN accounts a ON c.customer_id = a.customer_id 
GROUP BY c.customer_id, c.customer_name; 

๐Ÿ’ก Example 7: Identify Potentially Unusual Transactions 
SELECT account_id, transaction_id, transaction_date, amount 
FROM transactions 
WHERE amount > 100000 AND transaction_status = 'Success' 
ORDER BY amount DESC; 

๐ŸŽฏ Key Insights You Can Derive 

๐Ÿ”น Which branches generate the highest transaction volume? 
๐Ÿ”น Which customer segments hold the most deposits? 
๐Ÿ”น Who are the highest-value customers? 
๐Ÿ”น Which account types have the highest activity? 
๐Ÿ”น How are deposits and withdrawals trending? 
๐Ÿ”น Which customers have significant loan exposure? 
๐Ÿ”น Which transactions may require additional investigation? 

๐Ÿ’ผ Double Tap โค๏ธ For More
  • โค 7
More from @sqlanalyst
  1. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  2. Oct 7, 2026SQL Interview Series โ€” Part 4 ๐Ÿ“Œ Question 4: Find the Highest Salary in Each Department Suโ€ฆ
  3. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
  4. Sep 29, 2026SQL Interview Series โ€” Part 2 ๐Ÿ“Œ Question 2: Find Duplicate Records Suppose you have an Emโ€ฆ
  5. Sep 29, 2026๐—™๐—ฅ๐—˜๐—˜ ๐—ฅ๐—ฒ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐—ง๐—ผ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป ๐—”๐—œ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ๐Ÿš€ โ€‹ Explore 6 free resourceโ€ฆ
  6. Sep 29, 2026SQL Interview Series โ€” Part 1 Hi guys, let's start a SQL interview series covering frequenโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’