๐ 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
Post #2675
2.44K
- โค 7