Skip to content

ahmedsamir-netizen/ecommerce-sql-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README.md

E-commerce SQL Data Analysis Project

📌 Overview

This project analyzes e-commerce sales data to extract actionable insights and generate professional visualizations. It showcases data cleaning, exploratory data analysis (EDA), and key trends in sales, revenue, and product performance.

🛠️ Technologies Used

  • Python 3.8+
  • Pandas
  • MySQL
  • SQL
  • python-dotenv
  • Seaborn
  • Matplotlib

🔄 Project Workflow

  1. Data Cleaning

    • Removed missing values
    • Filtered out negative quantities (returns)
    • Created a revenue column
  2. Data Loading

    • Loaded cleaned data into MySQL database
  3. Data Analysis

    • Executed advanced SQL queries to analyze:
      • Revenue
      • Customers
      • Products
      • Sales trends
  4. Insights Generation

    • Extracted actionable business insights

📁 Project Structure

ecommerce-sql-analysis/
├── data/
│   ├── data.csv
│   └── clean_data.csv
├── assets/
│   ├── revenue_by_country.png
│   ├── top10_products_quantity.png
│   ├── profit_vs_revenue.png
│   ├── sales_over_time.png
│   └── revenue_distribution.png
├── src/
│   ├── clean_data.py
│   ├── load_data.py
│   └── db_connection.py
├── sql/
│   └── queries.sql
├── insights/
│   └── insights.md
├── schema.sql
└── README.md

🚀 How to Run

  1. Install dependencies:
pip install -r requirements.txt
  1. Create MySQL database:
CREATE DATABASE ecommerce_analysis;
  1. Run cleaning script:
python src/clean_data.py
  1. Load data:
python src/load_data.py
  1. Run SQL queries in MySQL

📊 Visualizations

1️⃣ Total Revenue by Country

Revenue by Country

2️⃣ Top 10 Products by Quantity Sold

Top 10 Products by Quantity

3️⃣ Profit vs Revenue Scatter

Profit vs Revenue

4️⃣ Revenue Over Time

Revenue Over Time

5️⃣ Revenue Distribution per Invoice

Revenue Distribution


📈 Key Analysis Areas

  • Revenue analysis
  • Customer segmentation
  • Product performance
  • Sales trends
  • Geographic insights

💡 Key Features

  • Real-world dataset
  • End-to-end data pipeline
  • Advanced SQL queries
  • Business insights generation

🎯 Purpose

This project demonstrates practical data analysis skills for real-world freelance and business scenarios.

📝 Notes

  • X-axis labels and figure sizes are optimized for readability.
  • All figures are saved as high-resolution PNGs.
  • Ready to showcase on GitHub, Upwork portfolio, or presentations.

⭐ Support

If you like this project, feel free to star the repository!

About

End-to-end E-commerce SQL Data Analysis Project: Data cleaning, MySQL loading, advanced queries, and actionable business insights.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages