top of page

Banking Data Analysis (SQL)

  • Writer: Brandon Hopkins
    Brandon Hopkins
  • Jan 17, 2023
  • 2 min read

Updated: Jan 20, 2023

Introduction


This project was designed to simulate a scenario where I was hired as a financial data analyst to review bank loan data and provide insights. The analysis was done completely using SQL - for this project I used bit.io, an open source site using serverless postgreSQL. The data was available through the World Bank website and consisted of IDA statement of credits (loans) and grants historical data. The data was in .csv form and was uploaded to bit.io for analysis.


As part of the analysis, my goal was to provide to stakeholders answers to the following questions:

  • Show all transactions from India

  • How many total transactions from India?

  • How many total transactions per country?

  • What is the max owed to the IDA and how much total is owed to the IDA?

  • What is the average service charge rate for a loan?

  • Which countries have the most loans?

Analysis


To start the analysis, I first wrote a basic query to see the table in it's entirety and familiarize myself with the columns. From there, I just added in a WHERE clause to show all the transactions from India (below).


Taking one step further, I added a COUNT function into the SELECT clause to determine the total transactions from India, which was 58,339.


Next, I wanted to see the number of transactions by country. To do so, I used the COUNT function again and combined this with the GROUP BY statement.



Another useful piece of information for stakeholders would be an aggregate summary of the maximum amount owed to the IDA from one loan, the total amount owed from all loans, and the average service charge rate per loan. I was able to find these values in a single query (below) using the MAX, SUM, and AVG functions and casting the service charge rate as a numeric value and then rounding to 3 decimal places.



Finally, I provided a table of the top 5 countries that have the most loans by using the COUNT function, grouping the results by country, then ordering by the number of loans in descending order.



Closing Thoughts


SQL is such a powerful tool for analysis, and even with the more "basic" queries used in this analysis you are able to extract so much information! Using SQL, I provided stakeholders with an answer to each of their questions:


Show all transactions from India.

A: See resulting table


How many total transactions from India?

A: 58,339 transactions


How many total transactions per country?

A: See resulting table


What is the max owed to the IDA and how much total is owed to the IDA?

A: Max Owed - $ 793,256,127.64

Total Owed - $ 20,164,338,829,274.426


What is the average service charge rate for a loan?

A: 0.778


Which countries have the most loans?

A: See table below

Country

Number of Loans

India

58,339

Bangladesh

40,980

Pakistan

35,202

Tanzania

34,060

Ghana

30,849

As always, please reach out for any questions, comments, or feedback on LinkedIn!


 
 
 

Comentarios


  • alt.text.label.LinkedIn

Thanks for visiting!

©2022 by Brandon Hopkins | Data Enthusiast.

Proudly created with Wix.com

bottom of page