lasyakonduru/E-Commerce-Analysis-Using-Advanced-SQL
This project analyzes e-commerce order fulfillment using Advanced SQL Techniques and Python-based visualization to uncover insights on sales trends, customer segmentation, shipping cost optimization, and payment preferences.
E-Commerce Order Fulfillment Analysis
๐ Project Overview
This project analyzes the order fulfillment process of an e-commerce business, covering sales trends, product performance, customer segmentation, shipping cost optimization, and payment method analysis.
Using Advanced SQL Techniques and Python-based data visualization, we extract insights to help businesses improve logistics, boost sales, and enhance customer satisfaction.
๐ฏ Objectives
โ Optimize order processing efficiency โ Track delays and enhance fulfillment times.
โ Identify top-selling products โ Understand which products generate the highest revenue.
โ Segment high-value customers โ Analyze customer spending behavior and engagement.
โ Reduce shipping costs โ Evaluate cost variations based on order priority.
โ Identify preferred payment methods โ Determine customer payment preferences for better financial strategies.
๐ Dataset Overview
- Source: E-Commerce transaction records with 51,290 rows and 16 columns
- Data Transformation: The raw dataset was normalized into four tables for efficient querying:
Ordersโ Order details, including sales, profit, and shipping costs.Customersโ Customer demographics such as gender, login type, and device.Productsโ List of all products and their categories.Categoriesโ Broader classification of product types.
๐ Advanced SQL Techniques Used
This project incorporates Advanced SQL Techniques to improve query performance, simplify analysis, and generate powerful insights:
1๏ธโฃ Window Functions
- Used to rank top-selling products and calculate cumulative sales over time.
- Helps in understanding product demand trends dynamically.
2๏ธโฃ Common Table Expressions (CTEs)
- Simplifies customer segmentation analysis by organizing complex queries.
- Enhances readability and maintains modular query execution.
3๏ธโฃ Ranking Functions (RANK() OVER)
- Assigns rankings to products based on total sales.
- Useful for identifying best-performing items efficiently.
4๏ธโฃ Partitioning & Indexing for Performance Optimization
- Used for query optimization, especially for large datasets.
- Ensures faster retrieval of insights from orders and customer data.
๐ Business Insights & Findings
๐ Sales & Revenue Analysis
- The business generated $7.8M in total sales, with a $3.6M profit margin.
- Sales peaked in May and November, indicating strong seasonal demand trends.
๐ Top-Selling Products
- The highest-selling categories were Fashion and Footwear, with T-Shirts, Watches, and Running Shoes leading sales.
- Bundling slower-moving items with high-performing products could increase sales.
๐ Customer Segmentation & Retention
- High-spending customers are primarily male, highlighting an opportunity for targeted promotions.
- A VIP loyalty program can enhance customer retention and increase repeat purchases.
๐ Order Fulfillment & Shipping Cost Optimization
- High-priority orders have significantly higher shipping costs.
- Encouraging bulk orders and standard delivery options can help reduce logistics expenses.
๐ Payment Method Preferences
- Credit cards dominate transactions (74% of total revenue), while e-wallet adoption remains low.
- Promoting digital payment incentives can increase checkout conversion rates.
๐ก Business Recommendations
๐ Optimize Order Processing Efficiency
- Implement automation in warehouses to reduce the average processing time (currently 5.25 days).
- Introduce real-time order tracking to enhance transparency and customer trust.
๐ Increase Revenue with Targeted Promotions
- Leverage seasonal sales trends by launching exclusive discounts during peak months.
- Promote high-ranking products (T-Shirts, Watches, and Shoes) through advertising.
๐ Improve Customer Retention Strategies
- Create personalized offers for repeat customers based on purchase history.
- Implement a loyalty program to encourage repeat spending.
๐ Reduce Shipping Costs Without Affecting Delivery Time
- Offer free standard shipping for bulk orders to reduce per-item logistics costs.
- Optimize partnerships with shipping carriers for discounted high-priority shipping rates.
๐ Enhance Payment Flexibility & Checkout Experience
- Encourage e-wallet and debit card transactions by offering cashback incentives.
- Introduce Buy Now, Pay Later (BNPL) options to reduce cart abandonment.
๐ง Technologies Used
- Database: SQLite
- Query Language: SQL
- Data Processing: Pandas
- Visualization: Matplotlib, Seaborn
- Development Environment: Jupyter Notebook
๐ Project Files & Repository Structure
๐ Ecommerce_SQL_DATAProject.db โ SQLite database file
๐ ecommerce_schema.sql โ Collection of SQL scripts used in analysis
๐ E_Commerce_Analysis_using_Advanced_SQL.ipynb โ Jupyter Notebook for SQL execution & visualization
๐ E_Commerce_Analysis_using_Advanced_SQL.html โ Summary of key insights & recommendations
๐ README.md โ Documentation for project overview and findings
๐ How to Run the Project
1๏ธโฃ Clone the repository
git clone https://github.com/yourusername/E-Commerce-Analysis-Using-Advanced-SQL.git
cd ecommerce-sql-analysis2๏ธโฃ Load the database (Ecommerce_SQL_DATAProject.db) into SQLite or DB Browser for SQLite.
3๏ธโฃ Execute SQL queries from ecommerce_schema.sql to explore insights.
4๏ธโฃ Run E_Commerce_Analysis_using_Advanced_SQL.ipynb in Jupyter Notebook to visualize trends using Python.
๐ฎ Future Enhancements
๐ Use Machine Learning to predict future sales trends.
๐ Enhance customer segmentation with clustering algorithms.
๐ Develop an interactive dashboard using Power BI or Tableau.
๐ค Author
๐น Lasya Priya Konduru
๐ง konduru.lasya@gmail.com
๐ LinkedIn: (https://www.linkedin.com/in/lasya-priya-k/)
If you found this project useful, โญ Star this repository and feel free to contribute! ๐