GitHunt
LA

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-analysis

2๏ธโƒฃ 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! ๐Ÿš€