This project demonstrates SQL analysis on a sample fintech banking dataset. It covers customer profiles, accounts, loans, transactions, and support tickets, then uses SQL queries to explore customer segmentation, balances, loan behavior, support activity, and window-function based rankings.
Fintech SQL Analysis Cleaned.sql- database setup, sample inserts, and analysis queriesER_Diagram.md- Mermaid ER diagram for the database schemadataset/- CSV exports of each sample table
The project uses five related tables:
CUSTOMERS- customer demographic and credit informationACCOUNTS- account type, balance, status, and open dateLOANS- loan amount, interest rate, and approval statusTRANSACTIONS- credit/debit transactions linked to accountsSUPPORT_TICKETS- customer support issues and resolution time
- Table creation with primary keys and foreign keys
INSERTstatements for sample data- String functions such as
CONCAT,UPPER,LEFT, andSUBSTRING_INDEX - Null handling with
COALESCEandNULLIF - Conditional logic with
CASE - Inner joins
- Aggregate functions such as
COUNT,MAX, andAVG - Subqueries
- Common table expressions
- Window functions such as
RANK,DENSE_RANK, and running totals
- Which customers have credit scores above 750?
- Which account types have above-average balances?
- Who are the top two customers by balance within each account type?
- Which customers have never taken a loan?
- Which customers have raised support tickets?
- Which loans have interest rates below the overall average?
- Which customers have balances above the average for their city?
- Open MySQL Workbench or another MySQL-compatible SQL client.
- Run
Fintech SQL Analysis Cleaned.sql. - The script creates the
FINTECH_ANALYTICSdatabase, loads sample data, and includes analysis queries.
The ER diagram is available in ER_Diagram.md. GitHub can render the Mermaid diagram directly in Markdown.
The dataset folder contains CSV files matching the inserted SQL sample data:
customers.csvaccounts.csvloans.csvtransactions.csvsupport_tickets.csv
- SQL
- MySQL
- GitHub Markdown
- Mermaid ER diagrams