An end-to-end data engineering + analytics project that transforms raw customer shopping data into actionable business insights using Python, MySQL, and Power BI.
Interactive Power BI dashboard showing KPIs, customer segmentation, and revenue insights.
This project demonstrates a complete data pipeline:
- Raw data ingestion from CSV
- Data cleaning & preprocessing using Python (Pandas)
- Data storage and querying using MySQL
- Interactive dashboard creation using Power BI
The objective is to analyze customer purchasing behavior, revenue trends, and business performance.
- Python (Pandas) → Data cleaning & transformation
- MySQL → Data storage & analytical queries
- SQLAlchemy → Database connection
- Power BI → Data visualization
- Jupyter Notebook → Development environment
Customer-Behaviour-Analytics
├── data/
│ └── cust_shopping_behavior.csv
├── notebooks/
│ └── project.ipynb
├── sql/
│ └── customer_behaviour.sql
├── dashboard/
│ └── customer_behaviour_dashboard.pbix
├── assets/
│ └── dashboard.png
├── README.md
- Handled missing values (median imputation)
- Converted data types
- Ensured data consistency and quality
- Created database:
customer_behaviour - Loaded cleaned data into SQL tables
- Used SQLAlchemy for seamless integration
SELECT gender, SUM(purchase_amount) AS revenue
FROM customer
GROUP BY gender;SELECT item_purchased, ROUND(AVG(review_rating),2)
FROM customer
GROUP BY item_purchased
ORDER BY AVG(review_rating) DESC
LIMIT 5;SELECT item_purchased,
ROUND(100.0 * SUM(CASE WHEN discount_applied='Yes' THEN 1 ELSE 0 END)/COUNT(*),2)
FROM customer
GROUP BY item_purchased
ORDER BY 2 DESC
LIMIT 5;More queries available in:
sql/customer_behaviour.sql
- Young adults generate the highest revenue
- Clothing category dominates both revenue & sales
- Discounts significantly influence purchasing behavior
- Subscription status impacts customer spending patterns
git clone https://github.com/your-username/customer-behaviour-analytics.git
cd customer-behaviour-analyticspip install pandas sqlalchemy pymysqljupyter notebook notebooks/project.ipynb- Create MySQL database
- Run SQL file:
source sql/customer_behaviour.sql;- Open
customer_behaviour_dashboard.pbixin Power BI
Aryan Srivastava
