An end-to-end Data Analytics project focused on analyzing customer purchasing behavior, shopping patterns, customer retention, and product performance using Python, DuckDB, SQL, and Power BI.
Status: Completed
This project demonstrates a complete end-to-end analytics workflow, transforming over 3.4 million Instacart transactions into actionable business insights. The project covers the entire data analytics pipeline, including data ingestion, database creation, SQL-based business analysis, interactive Power BI dashboard development, and comprehensive project documentation.
- ✅ Data Understanding
- ✅ DuckDB Database Setup
- ✅ SQL Business Analysis
- ✅ Customer Analytics
- ✅ Dashboard SQL Views
- ✅ Executive Overview Dashboard
- ✅ Customer & Product Insights Dashboard
- ✅ Business Report
- ✅ Project Documentation
- ✅ GitHub Portfolio Ready
The Executive Overview dashboard provides a high-level view of Instacart's business performance, enabling stakeholders to monitor operational KPIs, ordering trends, customer segmentation, and department-level performance.
Key Highlights
- 📦 Total Orders
- 👥 Total Customers
- 🛒 Total Products
- 🧺 Average Basket Size
- 🔄 Overall Reorder Rate
- ⏰ Orders by Hour
- 📅 Orders by Day of Week
- 👤 Customer Value Segmentation
- 🏬 Department Performance
The Customer & Product Insights dashboard focuses on customer retention, loyalty, and product performance to identify opportunities for improving customer engagement and driving repeat purchases.
Key Highlights
- 📈 Top 10 Purchased Products
- 📊 Customer Retention Analysis
- 🔄 Subscription Opportunity Products
- 🏆 Top 10 Loyal Customers
The objective of this project is to analyze customer purchasing behavior and generate actionable business insights that can help Instacart improve customer retention, optimize product recommendations, and identify recurring purchasing patterns.
The project focuses on:
- Customer purchasing behavior
- Product performance
- Customer segmentation
- Customer loyalty
- Customer retention
- Subscription opportunity analysis
- Business KPI reporting
- Interactive dashboard development
Instacart/
│
├── SQL/
│ ├── business_analysis.sql
│ ├── customer-analytics.sql
│ └── views.sql
│
├── notebook/
│
├── Instacart-Analysis-Workflow.png
├── setup_database.py
├── .gitignore
└── README.md
This project uses the Instacart Online Grocery Shopping Dataset.
The dataset contains over 3 million grocery transactions from more than 200,000 customers, including purchasing history, products, aisles, and departments.
- Orders
- Prior Orders
- Products
- Aisles
- Departments
Note
The raw dataset is not included in this repository because of its large size.
Download the dataset separately and place the CSV files inside a local data/ folder.
After downloading the dataset, simply run:
python setup_database.pyThis script automatically:
- Creates the DuckDB database
- Imports all CSV files
- Creates the required database tables
Instead of using MySQL, this project uses DuckDB, an analytical database optimized for fast OLAP queries on large datasets.
The database setup includes:
- Database creation
- CSV import
- Table creation
- Relationship validation
- Dashboard view creation
The project contains business-focused SQL analyses designed to answer practical business questions.
- Customer Segmentation
- Customer Loyalty Analysis
- Customer Retention Analysis
- High Value Customer Analysis
- Most Purchased Products
- Most Reordered Products
- Product Reorder Rate Analysis
- Subscription Opportunity Analysis
- Peak Ordering Hours
- Peak Ordering Days
- Average Basket Size
- Department Performance
- Repeat Purchase Analysis
- Product Affinity Analysis
SQL scripts are available in:
SQL/
├── business_analysis.sql
├── customer-analytics.sql
└── views.sql
The project includes two interactive Power BI dashboards designed to communicate business insights through executive-focused visualizations.
- Total Orders
- Total Customers
- Total Products
- Average Basket Size
- Overall Reorder Rate
- Orders by Hour
- Orders by Day of Week
- Customer Segmentation
- Department Performance
- Top Purchased Products
- Department Reorder Rate
- Customer Retention Analysis
- Subscription Opportunity Products
- Top Loyal Customers
The dashboards provide stakeholders with an intuitive view of customer behavior, operational trends, product demand, and opportunities to improve customer retention and recurring revenue.
The project answers business questions including:
- When do customers place the most orders?
- Which products are purchased most frequently?
- Which products have the highest reorder rates?
- Which departments drive repeat purchases?
- Which customers are the most valuable?
- How does customer retention change over time?
- Which products are suitable for subscription services?
- Which customer segments should receive targeted marketing campaigns?
The analysis uncovered several valuable business insights:
- 📦 The platform processes over 3.4 million customer orders across more than 206,000 customers.
- ⏰ Customer demand peaks during the late morning and early afternoon.
- 📅 Sundays and Mondays experience the highest ordering activity.
- 🥦 Produce is the highest-performing department by purchase volume.
- 🍌 Bananas are the most frequently purchased product.
- 🔄 High reorder rates indicate strong customer loyalty in essential grocery categories.
- 💳 Several products show strong potential for subscription or auto-replenishment services.
- 📈 Customer retention gradually declines over successive purchases, highlighting opportunities for targeted loyalty programs.
- Dataset Exploration
- Relationship Analysis
- Schema Understanding
- DuckDB Setup
- CSV Import
- Database Creation
- Business Analysis
- Customer Analytics
- Customer Segmentation
- Customer Loyalty
- Customer Retention
- Dashboard SQL Views
- Executive Dashboard
- Product Analytics Dashboard
- Customer Analytics Dashboard
- Dashboard Optimization
- Business Report
- Dashboard Insights
- Final Documentation
This repository includes:
- 🐍 Python Database Setup Script
- 🦆 DuckDB Database
- 🗄 SQL Business Analysis Scripts
- 📊 Power BI Dashboards
- 📑 Project Report
- 🎤 Project Presentation
- 📈 Dashboard Screenshots
- 📚 Complete Documentation
- Python
- Pandas
- NumPy
- DuckDB
- SQL
- Power BI
- Matplotlib
- Jupyter Notebook
- VS Code
- Git
- GitHub
- Customer Churn Prediction
- Product Recommendation System
- Demand Forecasting
- Customer Lifetime Value Analysis
- Dashboard Deployment
Abdul Samhoon
This project demonstrates a complete end-to-end Data Analytics workflow using real-world retail data. From importing over 3.4 million transactions into DuckDB to performing SQL-based business analysis and developing interactive Power BI dashboards, it showcases practical skills in data engineering, analytics, business intelligence, and dashboard design. The project emphasizes business storytelling by converting complex transactional data into actionable insights that support operational planning, customer retention, and strategic decision-making.
If you found this project interesting, feel free to ⭐ this repository.


