{"id":17568717,"url":"https://github.com/patriciavalentine/loan-data-queries","last_synced_at":"2026-07-02T06:32:56.604Z","repository":{"id":258232190,"uuid":"860344446","full_name":"patriciavalentine/LOAN-DATA-QUERIES","owner":"patriciavalentine","description":"In this project, I analyzed a vehicle loan dataset using BigQuery to identify demographic, financial, and loan patterns. Through SQL queries, I extracted insights such as the credit scores, and loan distribution by region, and explored high-risk profiles. The findings are visualized in Looker Studio, thus helping to inform strategic decisions.","archived":false,"fork":false,"pushed_at":"2024-10-16T09:40:15.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T15:18:09.065Z","etag":null,"topics":["asset-finance","bigquery","loan-data","looker-studio"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patriciavalentine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-20T09:04:19.000Z","updated_at":"2024-10-16T09:40:22.000Z","dependencies_parsed_at":"2024-10-18T04:22:13.419Z","dependency_job_id":"13609124-47b3-4354-bfa3-62d3447c8aeb","html_url":"https://github.com/patriciavalentine/LOAN-DATA-QUERIES","commit_stats":null,"previous_names":["patriciavalentine/loan-data-queries"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciavalentine%2FLOAN-DATA-QUERIES","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciavalentine%2FLOAN-DATA-QUERIES/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciavalentine%2FLOAN-DATA-QUERIES/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciavalentine%2FLOAN-DATA-QUERIES/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patriciavalentine","download_url":"https://codeload.github.com/patriciavalentine/LOAN-DATA-QUERIES/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246193404,"owners_count":20738485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asset-finance","bigquery","loan-data","looker-studio"],"created_at":"2024-10-21T17:05:28.639Z","updated_at":"2025-10-30T14:21:14.923Z","avatar_url":"https://github.com/patriciavalentine.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📊 VEHICLE LOAN ANALYTICS\nThis is a project entailing a detailed analysis of a vehicle loan dataset for an Asset Financing Company. The Exploratory Data Analysis (EDA) involved exploring key areas such as demographics, financial stability, employment trends, risk assessment, and profitability.\n\n*I first performed an extensive dataset analysis using `BigQuery` to run a significant number of SQL queries.\nThen, I visualized the findings in `Looker Studio`, enabling data-driven strategic decisions for optimizing loan offerings and managing risks effectively.*\n\n# Uncovering Patterns in Vehicle Loan Data\n## 🧑‍💻 The Project Overview\nUsing `BigQuery`, I executed SQL queries to analyze the demographics of loan applicants — such as age, gender, and geographic distribution — to uncover insights for more effective targeted marketing strategies.\nThen, I assessed the applicants' financial well-being by examining their credit scores, income disparities, and correlations between income and credit scores to identify high-risk profiles.\nI then explored employment trends to understand their impact on loan amounts.\nFinally, I conducted a profitability analysis by comparing loan requests from existing and new customers and evaluating interest rate scenarios for potential returns.\n\n\u003eThis project ultimately helps the Asset Financing Company better understand its customer base and optimize loan offerings for profitability while minimizing risk.\n\n### 📁 The Files\n1. [The Dataset](https://storage.cloud.google.com/vehicle_loan_data/Vehicle%20Loan%20Dataset.csv).\n2. [The BigQuery SQL Queries](https://github.com/patriciavalentine/LOAN-DATA-QUERIES-AND-VISUALS/blob/main/Loan%20Queries.sql).\n3. [The Looker Visualizations](https://github.com/patriciavalentine/LOAN-DATA-QUERIES/blob/main/VEHICLE_LOANS_VISUALIZATIONS.pdf).\n\n### 🛠️Tools Used\n- **The Google Cloud Storage**: Stored the vehicle loan dataset for secure, scalable, and efficient data handling.\n- **BigQuery**: Ran a series of SQL queries on the loan dataset to derive insights.\n- **Looker Studio**: Created dynamic, interactive visualizations of the analyzed data, enabling deeper insights.\n\n\n### 📇 Sample of the Dataset:\n![Loan Data - Sample](https://github.com/user-attachments/assets/6b1f1212-aae8-4796-9398-97ae4987e6b9)\n*Source - [Kaggle](https://www.kaggle.com/datasets/yashkmd/credit-profile-two-wheeler-loan-dataset)!*\n\n\n# THE SQL 📈 QUERIES \u0026 RESULTS\n![loan-approved-application-form-concept](https://github.com/user-attachments/assets/d38c9251-954a-4983-8be4-9ba40c4e40ac)\n\n## 1. 👪 DEMOGRAPHICS ANALYSIS\nIn this section, I analyzed gender distributions, calculated the average age of loan applicants,  and explored the geographic spread of applicants across states and cities. This analysis helped in understanding the demographics of the loan applicants, which is crucial for targeted marketing.\n\n### Question 1:\n**How many applicants are male, female, or other?**\n```sql\nSELECT Gender, COUNT(*) AS Applicant_count\nFROM `Vehicle_Loan_Data.Credit Data`\nGROUP BY Gender;\n```\n![By Gender](https://github.com/user-attachments/assets/fd89b7a8-e3aa-48e2-95d8-4dc7950a1c2a)\n\n\n### Question 2:\n**What is the distribution of applicants across different states?**\n```sql\nSELECT State, COUNT(*) AS Applicant_count\nFROM `Vehicle_Loan_Data.Credit Data`\nGROUP BY State\nORDER BY 2 DESC;\n```\n![By State](https://github.com/user-attachments/assets/1f7524ca-d2b3-4dcf-946d-821a4b344a79)\n\n\n### Question 3:\n**What is the average age of the applicants?**\n```sql\nSELECT ROUND(AVG(Age), 0) AS Avg_age\nFROM `Vehicle_Loan_Data.Credit Data`;\n```\n![Avg Age](https://github.com/user-attachments/assets/c9fba08b-6d3c-4ac8-bdd9-136159146ed5)\n\n\n### Question 4:\n**Which cities have the highest number of loan applicants?**\n```sql\nSELECT City, COUNT(*) AS Applicant_count\nFROM `Vehicle_Loan_Data.Credit Data`\nGROUP BY City\nORDER BY Applicant_count DESC\nLIMIT 3;\n```\n![Top 3 Cities](https://github.com/user-attachments/assets/96dd1df7-260c-44f9-a719-83f1f80bbac0)\n\n\n## 2. 💸 FINANCIAL STABILITY\nI conducted a thorough examination of the financial stability of applicants by calculating average credit scores and identifying those with low credit scores.\nAdditionally, I analyzed income disparities among applicants to understand their financial backgrounds better.\n\nFurthermore, I investigated correlations between income and credit scores to identify high-risk profiles, such as applicants with low income and poor credit histories.\nI also analyzed loan requests by breaking down the average loan tenure and Loan-to-Value (LTV) ratios, particularly focusing on high-risk loans where the LTV exceeds 80%.\n\n### Question 1:\n**What is the average credit score of all applicants?**\n```sql\nSELECT AVG (`Credit Score`) AS Avg_credit_score\nFROM `Vehicle_Loan_Data.Credit Data`;\n```\n![Avg Credit score](https://github.com/user-attachments/assets/4482034e-b0c3-4f4a-b9b4-96430476c907)\n\n\n### Question 2:\n**Which applicants have a credit score below 500, and how many are there?**\n```sql\nSELECT COUNT(*) AS Low_credit_applicants\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `Credit Score` \u003c 500;\n```\n![Low credit applicants](https://github.com/user-attachments/assets/f0688232-fc46-447c-bd20-0dfc13dc4e90)\n\n\n### Question 3:\n**What is the average credit history length (in months) of all applicants?**\n```sql\nSELECT AVG(`Credit History Length`) AS Avg_credit_history\nFROM `Vehicle_Loan_Data.Credit Data`;\n```\n![Avg Credit history](https://github.com/user-attachments/assets/8631bb43-c989-47e5-bda9-b48c1a8622a8)\n\n\n### Question 4:\n**What is the relationship between income and credit score?**\n```sql\nSELECT CORR(Income, `Credit Score`) AS Income_credit_correlation\nFROM `Vehicle_Loan_Data.Credit Data`;\n```\n![Income Credit Correlation](https://github.com/user-attachments/assets/e9b12576-d8a7-4b70-92f3-6c976d31c77d)\n\n\n### Question 5:\n**What percentage of the applicants have an income greater than ₹100,000?**\n```sql\nSELECT (COUNT(*) * 100.0 / (SELECT COUNT(*) FROM `Vehicle_Loan_Data.Credit Data`)) AS Percent_high_income\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE Income \u003e 100000;\n```\n![% High Income](https://github.com/user-attachments/assets/1005e34f-8463-4d9d-bb88-b30693ae9966)\n\n\n### Question 6:\n**Assuming the company is giving out loans at a 15% interest, what profit are they receiving per year?**\n\n**How much revenue are they having?**\n```sql\nSELECT SUM(`Loan Amount` * 0.15) AS Total_profit, SUM(`Loan Amount`) AS Total_revenue\nFROM `Vehicle_Loan_Data.Credit Data`;\n```\n![Profit   Revenue](https://github.com/user-attachments/assets/3b815626-b8c8-49d8-840b-eaa60174c320)\n\n\n### Question 7:\n**What is the total sum of requested loan amounts by applicants from Maharashtra?**\n```sql\nSELECT SUM(`Loan Amount`) AS Total_loan_maharashtra\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE State = 'Maharashtra';\n```\n![Total loan in Maharashtra](https://github.com/user-attachments/assets/590b1745-b79b-4705-9c57-01be35cc51e4)\n\n\n### Question 8:\n**What is the average Loan-to-Value (LTV) Ratio of all applicants?**\n```sql\nSELECT AVG(`LTV Ratio`) AS Avg_ltv\nFROM `Vehicle_Loan_Data.Credit Data`;\n```\n![Avg LTV](https://github.com/user-attachments/assets/52e38253-42e5-4059-9979-489fbd99ad4f)\n\n\n### Question 9:\n**Which loans have a Loan Tenure of over 60 months and an LTV ratio greater than 80%?**\n```sql\nSELECT *\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `Loan Tenure` \u003e 60 AND `LTV Ratio` \u003e 80;\n```\n\n### Question 10:\n**What is the distribution of loan amounts requested?**\n```sql\nSELECT CASE \n             WHEN `Loan Amount` \u003c 50000 THEN 'Below ₹50,000'\n             WHEN `Loan Amount` BETWEEN 50000 AND 100000 THEN '₹50,000 - ₹100,000'\n             ELSE 'Above ₹100,000'\n          END AS Loan_range,\n       COUNT(*) AS Loan_count\nFROM `Vehicle_Loan_Data.Credit Data`\nGROUP BY Loan_range;\n```\n![Loan range   count](https://github.com/user-attachments/assets/fe7f4b8f-d015-4847-a6b8-8441e3cdecd6)\n\n\n\n### Question 11:\n**What is the average loan tenure for all loans?**\n```sql\nSELECT ROUND(AVG(`Loan Tenure`), 0) AS Avg_loan_tenure\nFROM `Vehicle_Loan_Data.Credit Data`;\n```\n![Avg Loan Tenure](https://github.com/user-attachments/assets/9b6240f3-ee34-4539-90a3-a5c6e70bb971)\n\n\n\n## 3. 👩‍💼 EMPLOYMENT AND OCCUPATION TRENDS\nUsing SQL queries, I explored employment and occupation-related trends to determine which employment categories and occupations request higher loan amounts.\nThis analysis is essential for understanding how employment types influence loan requests and associated risks.\n\n### Question 1:\n**Which employment category has the highest average income?**\n```sql\nSELECT `Employment Profile`, ROUND(AVG(`Income`), 2) AS Avg_income\nFROM `Vehicle_Loan_Data.Credit Data`\nGROUP BY `Employment Profile`\nORDER BY Avg_income DESC;\n```\n![Employment Profile Vs Income](https://github.com/user-attachments/assets/f5552631-bd45-4dbb-ae98-79e46da2cebd)\n\n\n\n### Question 2:\n**What is the average loan amount requested by applicants in each occupation?**\n```sql\nSELECT `Occupation`, ROUND(AVG(`Loan Amount`), 2) AS Avg_loan_amount\nFROM `Vehicle_Loan_Data.Credit Data`\nGROUP BY `Occupation`\nORDER BY Avg_loan_amount DESC;\n```\n![Occupation Vs Loan amount](https://github.com/user-attachments/assets/8232e1d4-c9d0-4ef2-b85c-d58667b1067a)\n\n\n## 4. ⚠️ RISK ASSESSMENT\nRisk assessment is another critical focus of this project.\n\nThis is where I identified applicants with multiple existing loans and high LTV ratios that may pose significant risks.\nBy analyzing these factors, I aimed to provide insights into which applicants may be more likely to default on their loans.\n\n### Question 1:\n**Which applicants have an LTV ratio above 80% and more than 3 existing loans?**\n```sql\nSELECT *\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `LTV Ratio` \u003e 80 AND `Number of Existing Loans` \u003e 3;\n```\n\n### Question 2:\n**Which applicants with a credit score below 600 have more than 2 existing loans?**\n```sql\nSELECT *\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `Credit Score` \u003c 600 AND `Number of Existing Loans` \u003e 2;\n```\n\n### Question 3:\n**What is the total outstanding loan amount for applicants with more than 5 existing loans?**\n```sql\nSELECT SUM(`Loan Amount`) AS Total_outstanding_loan\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `Number of Existing Loans` \u003e 5;\n```\n![total outstanding loan amount for applicants with more than 5 existing loans](https://github.com/user-attachments/assets/177fd899-3c37-4385-ab3e-5c79236216b6)\n\n\n\n### Question 4:\n**What is the average loan amount requested by applicants with a credit score below 400?**\n```sql\nSELECT ROUND(AVG(`Loan Amount`), 2) AS Avg_loan_amount\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `Credit Score` \u003c 400;\n```\n![average loan amount requested by applicants with a credit score below 400](https://github.com/user-attachments/assets/172d2a8a-dd78-4682-a592-b9cb540132a3)\n\n\n### Question 5:\n**How many applicants have a profile score above 80 and a credit score above 700?**\n```sql\nSELECT COUNT(*) AS count\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `Profile Score` \u003e 80 AND `Credit Score` \u003e 700;\n```\n![How many applicants have a profile score above 80 and a credit score above 700](https://github.com/user-attachments/assets/1836cac2-30e8-42de-b552-947a9a742785)\n\n\n\n## 5. 📈 PROFITABILITY ANALYSIS\nI examined the loan requests of existing customers versus new customers and calculated profitability scenarios based on loan amounts and interest rates.\nThis analysis helps understand the potential returns from different customer segments.\n\n### Question 1:\n**What is the total loan amount requested by existing customers vs. new customers?**\n```sql\nSELECT `Existing Customer`, SUM(`Loan Amount`) AS Total_loan_amount\nFROM `Vehicle_Loan_Data.Credit Data`\nGROUP BY `Existing Customer`;\n```\n![What is the total loan amount requested by existing customers vs  new customers](https://github.com/user-attachments/assets/97c19ae8-1b04-42ea-b08d-1727e98a47c0)\n\n\n### Question 2:\n**If an applicant with an income of ₹50,000 requests a loan of ₹500,000, what should be their monthly EMI over a tenure of 60 months (assuming 15% interest)?**\n```sql\nWITH Loan_details AS\n                  (SELECT 500000 AS principal, 0.15 / 12 AS monthly_rate, 60 AS tenure_months)\n\nSELECT ROUND(principal * monthly_rate * POWER(1 + monthly_rate, tenure_months) / (POWER(1 + monthly_rate, tenure_months) - 1), 2)\n      AS monthly_emi\nFROM Loan_details;\n```\n![If an applicant with an income of ₹50,000 requests a loan of ₹500,000, what should be their monthly EMI over a tenure of 60 months (assuming 15% interest)](https://github.com/user-attachments/assets/0be05016-b969-425f-8724-b29571f9dba9)\n\n\n### Question 3:\n**What percentage of applicants with a loan tenure above 36 months have an LTV ratio greater than 85%?**\n```sql\nSELECT (COUNT(*) * 100.0 /\n                         (SELECT COUNT(*) FROM `Vehicle_Loan_Data.Credit Data` WHERE `Loan Tenure` \u003e 36))\n                                 AS percentage\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `Loan Tenure` \u003e 36 AND `LTV Ratio` \u003e 85;\n```\n![What percentage of applicants with a loan tenure above 36 months have an LTV ratio greater than 85%](https://github.com/user-attachments/assets/f541aad8-1843-44a2-a021-df59e393daa2)\n\n\n### Question 4:\n**Which applicants have requested loan amounts more than 4 times their annual income?**\n```sql\nSELECT *\nFROM `Vehicle_Loan_Data.Credit Data`\nWHERE `Loan Amount` \u003e 4 * `Income`;\n```\n\n\n# 📊 THE VISUALIZATIONS\nTo accompany the insights derived from the analysis, I created visualizations in Looker Studio.\n\n![Vehicle Loan Dashboard](https://github.com/user-attachments/assets/1108abe8-9ee2-46b2-8c34-b33790538bb0)\n\nTo view the Dashboard in Looker Studio, click [here](https://lookerstudio.google.com/reporting/d8eccb89-1dc5-4f6c-a001-34c2611801ac).\n\nThese visual representations of complex data patterns illustrate customer behavior, risk profiles, and loan distributions, supporting strategic business decisions and enhancing the overall understanding of the data.\n\n## CONCLUSION\nThis comprehensive analysis of the vehicle loan dataset has provided invaluable insights into applicants' profiles, their financial health, and the dynamics of loan performance within the Asset Financing sector.\n\nBy leveraging key inquiry questions, I was able to explore various dimensions of the data, including demographic trends, creditworthiness, and the distribution of loan amounts.\nThus, the insights derived from this project would offer a strategic foundation for the company to refine its lending practices and risk assessment procedures, which would then empower the company to navigate the complexities of the vehicle loan market, enhance competitiveness, and foster its long-term growth.\n\n\u003e `KINDLY NOTE`: For a detailed explanation of the query results, check [here](https://valepatricia16.wixsite.com/patricia-valentine/about-3-2).\n\n## THE END!\n### Thank you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatriciavalentine%2Floan-data-queries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatriciavalentine%2Floan-data-queries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatriciavalentine%2Floan-data-queries/lists"}