maitree7/Fraud_Detection_SQL
maitree7/Fraud_Detection_SQL has 106 GitHub stars and 35 forks. GitHot measured 0 stars in 24 hours and +1 in 7 days. Last checked 2026-11-11 20:16 UTC. Last push 2024-07-04.
Comment ces chiffres sont mesurés
Fraud Detection on credit card transations
Progression mesurée des étoiles
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- Mise à jour retardée
- in 1 month
- Mise à jour retardée
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalFraud_Detection_SQL

Credit Card Fraudster by Richard Patterson | Creative Commons Licensed
Background
Fraud is everywhere these days—whether you are a small taco shop or a large international business. While there are emerging technologies that employ machine learning and artificial intelligence to detect fraud, many instances of fraud detection still require strong data analytics to find abnormal charges.
Application of new SQL skills to analyze historical credit card transactions and consumption patterns in order to identify possible fraudulent transactions.
Accomplish three main tasks:
Data Modeling: Define a database model to store the credit card transactions data and create a new PostgreSQL database using your model.
Data Engineering: Create a database schema on PostgreSQL and populate your database from the CSV files provided.
Data Analysis: Analyze the data to identify possible fraudulent transactions.
Files
Query Files
CSV Files
Data Modeling
Create an entity relationship diagram (ERD) by inspecting the provided CSV files.
Note: For the credit_card table, the card column should be a VARCHAR(20) datatype rather than an INT.
Tool used to develop ERD Quick Database Diagrams to create your model.

Data Engineering
Using your database model as a blueprint, create a database schema for each of your tables and relationships. Specify data types, primary keys, foreign keys, and any other constraints you defined.
After creating the database schema, import the data from the corresponding CSV files.
Data Analysis
Now that your data is prepared within the database, it's finally time to identify fraudulent transactions using SQL and Pandas DataFrames.
Top 100 highest transactions during early hours i.e. 7:00 to 9:00 AM
Some fraudsters hack a credit card by making several small payments (generally less than $2.00), which are typically ignored by cardholders. Count the transactions that are less than $2.00 per cardholder. Is there any evidence to suggest that a credit card has been hacked? Explain your rationale.
What are the top five merchants prone to being hacked using small transactions?
Once you have a query that can be reused, create a view for each of the previous queries.
Created a report for fraudulent transactions of some top customers of the firm using Pandas, Plotly Express, hvPlot, and SQLAlchemy to create the visualizations.
- Fraudulent transactions in the history of two of the most important customers of the firm on the basis of their cardholders' IDs are 18 and 2.
Observation :
The consumption pattern for both the id holder is very different. Id Holder 2 makes too many small transactions. Id Holder 18 has transactions ranging till $1839. Id Holder 2 is more suspectable to fraudulent transactionsThe CEO of the firm's biggest customer suspects that someone has used her corporate credit card without authorization in the first quarter of 2018 to pay for several expensive restaurant bills. You are asked to find any anomalous transactions during that period.
- Using Plotly Express, created a series of six box plots, one for each month, in order to identify how many outliers there are per month for cardholder ID 25.
- Observations :
There seems to be fraudulent transactions pertaining to Restaurant & Food Truck category where Food Truck is ranging from $1.46 to $1046
Challenge
Another approach to identify fraudulent transactions is to look for outliers in the data. Standard deviation or quartiles are often used to detect outliers.
Identifying Outliers based on Standard Deviation
Identifying Outliers based on Interquartile Range
Explorer des projets similaires
Asabeneh/30-Days-Of-Python
Le défi de programmation 30 Days of Python est un guide pas à pas pour apprendre le langage de programmation Python en 30 jours. Ce défi peut prendre plus de 100 jours. Avancez à votre rythme. Ces vidéos peuvent aussi vous aider : https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,560 étoilesgrafana/grafana
Plateforme ouverte et composable d’observabilité et de visualisation de données. Visualise les métriques, les journaux et les traces issus de plusieurs sources, comme Prometheus, Loki, Elasticsearch, InfluxDB, Postgres et bien d’autres.
77,830 étoilesredis/redis
Pour les développeurs qui créent des applications en temps réel pilotées par les données, Redis est le cache, le serveur de structures de données et le moteur de requêtes documentaires et vectorielles préféré, le plus rapide et le plus riche en fonctionnalités.
77,395 étoilesapache/superset
Apache Superset est une plateforme de visualisation et d'exploration de données.
75,473 étoiles