This repository contains an end-to-end E-Commerce Enterprise Database, Analytical Warehouse, Python EDA, and Data Mining Pipeline. The project integrates a fully normalized relational database (SQL Server RDBMS), analytical reporting views, advanced exploratory data analysis (EDA) using Python, machine learning workflows in Orange Data Mining (Supervised Classification & Unsupervised Clustering), and comprehensive executive documentation.
The project has been organized into 5 core modular directories:
E-Commerce-Database-Project/
├── 01_Database_Schema/ # RDBMS DDL, Foreign Key Constraints & Seed Datasets
│ ├── Creating Tables - Ecommerce.sql
│ ├── Insert Tables - Ecommerce.sql
│ ├── tabled created.pdf
│ └── SQL_Tables_Dataset/ # 13 CSV dataset files + Dataset Inventory Report
│ ├── Dataset_Report.txt
│ ├── Tables Dataset.rar
│ ├── address.csv
│ ├── cart.csv
│ ├── category.csv
│ ├── customer.csv
│ ├── order_table.csv
│ ├── orderitem.csv
│ ├── payment.csv
│ ├── product.csv
│ ├── product_return.csv
│ ├── review.csv
│ ├── seller.csv
│ ├── shipment.csv
│ └── support_tickets.csv
│
├── 02_Analytical_Views/ # SQL Business Intelligence Views, KPIs & Analytical Queries
│ └── Questions - Ecommerce.sql
│
├── 03_Python_EDA/ # Python Exploratory Data Analysis & Interactive Notebooks
│ ├── EDA_Online_Retail.ipynb
│ ├── EDA_Report.html
│ └── data.xlsx # Online Retail Dataset (536K+ transactions)
│
├── 04_Orange_Data_Mining/ # Machine Learning & Clustering Workflows (Orange)
│ ├── Orange_Final.ows # Orange Visual Workflow Scheme
│ └── Orange_Widget_Report.docx # Data Mining Analysis & Widget Documentation
│
├── 05_Documentation_&_Presentation/ # Executive Reports, Presentation Slides & ERD Diagrams
│ ├── 01. Ecommerce_Project_Report.pdf
│ ├── 02. EDA Report — Online Retail Dataset.pdf
│ ├── Architecting_E-Commerce_Intelligence.pptx
│ └── ERD_Diagrams/
│ ├── ER_Diagram.png
│ ├── Relational Database Architecture.png
│ └── mindmap for tables.png
│
├── .gitignore # Git exclusion rules for temporary/junk files
└── README.md # Main Project Documentation
The foundational data layer is designed in Microsoft SQL Server (MS SQL) under the e_commerce schema. The relational architecture enforces 3rd Normal Form (3NF) across 13 core entity tables:
- Customer Management:
customer(Demographics, Age),address(Geographic & Shipping addresses). - Vendor & Catalog Management:
seller(Merchants),category(Product taxonomy),product(Inventory items, SKU, MRP, Stock). - Shopping Cart & Checkout:
cart(Session carts, conversion status),order_table(Order master),orderitem(Line items & pricing). - Financials & Logistics:
payment(Payment modes & status),shipment(Logistics provider, delivery status, SLA/Late flags). - Post-Purchase & CX:
product_return(Returns & refunds),review(Ratings & feedback),support_tickets(Support ticket tracking & SLA monitoring).
- Primary & Foreign Keys: Standardized single and composite keys ensuring strict entity integrity.
- Cascading Rules: Implemented
ON DELETE SET NULLandON UPDATE NO ACTIONto preserve historical order records even if customer entities change. - Validation: Includes field data types, nullability restrictions, and numerical constraints.
Located in 02_Analytical_Views/Questions - Ecommerce.sql, this module transforms normalized operational data into strategic decision-making insights via high-performance SQL Views and analytical queries:
vw_CustomerMaster: Aggregates customer total spend, lifetime order count, primary city, and acquisition date.vw_ProductCatalog: Dynamically labels inventory status (In Stock,Low Stock <= 80,Out of Stock <= 5) to optimize reordering.vw_OrderDetails: Denormalized order report merging items, line totals, customer info, payment status, and shipping stage.vw_ReturnRefundSummary: Consolidated returns tracker categorizing return reasons, status, and financial refund volume.vw_SupportSLA: Dynamically calculates resolution time in hours and flags SLA breaches according to ticket priority thresholds (High: 24h, Medium: 48h, Low: 72h).
- Daily Revenue & AOV: Computes daily revenue, order volume, and Average Order Value (AOV).
- Cart Conversion & Abandonment: Analyzes monthly cart conversion rates (Current metric: 87.5% conversion, 12.5% abandoned carts).
- Category Sales Ranking: Uses window functions (
DENSE_RANK() OVER (PARTITION BY category_id ORDER BY TotalRevenue DESC)) to rank top products per category. - Courier Delivery SLAs: Measures on-time delivery percentages and average transit days across couriers (e.g., Aramex, DHL, FedEx, UPS).
- Outstanding Balances: Identifies unpaid orders and revenue distribution across payment modes (Card, Cash on Delivery, Online, Wallet).
The EDA module analyzes over 536,000 transaction records using Python (pandas, numpy, matplotlib, seaborn, plotly).
- Data Cleansing & Wrangling: Imputed missing values, filtered out invalid entries and canceled invoice anomalies.
- RFM Customer Segmentation: Evaluated Recency, Frequency, and Monetary values to identify high-value VIP segments versus at-risk customers.
- Temporal & Sales Trends: Mapped peak buying hours, day-of-week velocity, and seasonal spikes.
- Product & Geographic Reach: Identified top-selling SKUs and analyzed country-level revenue distribution.
- Deliverables:
EDA_Online_Retail.ipynb: Complete interactive Jupyter Notebook.EDA_Report.html: Standalone interactive HTML report.
The data mining workflow (Orange_Final.ows) implements both Supervised Machine Learning and Unsupervised Clustering using Orange 3.
Five classification algorithms were trained and evaluated on an 80/20 Train/Test split:
-
k-Nearest Neighbors (k-NN) (
$k=7$ ) - Logistic Regression
- Decision Tree (Max depth = 8)
- Support Vector Machine (SVM) (Linear Kernel)
- Neural Network (Multi-layer Perceptron)
- Performance Tools: Test & Score node, Confusion Matrix, ROC Analysis curves, and Lift/Performance curves.
- Objective: Accurately predict transaction cancellations and customer churn prior to order fulfillment.
-
Algorithm: k-Means Clustering (
$k=2$ ). - Validation: Silhouette Plot analysis to evaluate cluster cohesion and separation quality.
This directory houses all executive presentation collateral and comprehensive technical reports:
- Executive Project Report:
01. Ecommerce_Project_Report.pdf— Complete project breakdown from database design to operational recommendations. - EDA Technical Report:
02. EDA Report — Online Retail Dataset.pdf— Statistical visual report detailing dataset characteristics. - PowerPoint Presentation:
Architecting_E-Commerce_Intelligence.pptx— Executive slide deck outlining database schema, analytics, and ML model performance. - ERD Visual Diagrams:
ER_Diagram.png: High-resolution Entity-Relationship Diagram.Relational Database Architecture.png: Relational schema diagram.mindmap for tables.png: Conceptual schema mindmap.
| Metric / Dimension | Value | Note |
|---|---|---|
| Total Database Tables | 13 Tables | Fully normalized 3NF schema |
| Total Order Volume | $674,798.90 | Over 700 customer orders |
| Delivered Revenue | $411,342.77 | 60.0% delivery completion rate |
| Cart Conversion Rate | 87.5% | 700 of 800 carts converted |
| Average Order Value (AOV) | $979.39 | Delivered orders average |
| Top Revenue Category | Electronics ($288.9K) | Followed by Home & Kitchen ($100.2K) |
| Top Merchant Seller | TechNova Ltd ($180.6K) | Top revenue contributor |
| Customer Support SLA Breaches | 69 Breached / 175 Tickets | SLA threshold: High (24h), Med (48h), Low (72h) |
- Open SQL Server Management Studio (SSMS) or Azure Data Studio.
- Execute
01_Database_Schema/Creating Tables - Ecommerce.sqlto build the database, schema, and tables. - Populate seed data using
01_Database_Schema/Insert Tables - Ecommerce.sqlor import CSV files from01_Database_Schema/SQL_Tables_Dataset/. - Execute
02_Analytical_Views/Questions - Ecommerce.sqlto generate all analytical views and KPIs.
pip install pandas numpy matplotlib seaborn plotly jupyter
jupyter notebook 03_Python_EDA/EDA_Online_Retail.ipynbOr open 03_Python_EDA/EDA_Report.html in any web browser.
- Install Orange Data Mining 3.
- Open
04_Orange_Data_Mining/Orange_Final.owsin Orange 3 to view model connections, confusion matrices, and ROC curves.
Developed as part of the Data Mining and Visualization curriculum. Designed for enterprise-grade e-commerce database architecture and data analytics.
