Skip to content

Sanaurrehmanarain/Retail-Sales-Analytics-SQL

Repository files navigation

Retail-Sales-Analytics-SQL

Click the banner to view the full analysis report

📊 End-to-End Retail Sales Analytics

Python MySQL Status

📌 Project Overview

This project demonstrates a full-cycle data analysis workflow—from raw data extraction to actionable business insights. Using a real-world Superstore Retail Dataset, I engineered a pipeline to load data into a MySQL database, performed complex SQL analysis, and visualized the results using Python (Matplotlib/Seaborn).

The goal was to answer critical business questions regarding sales trends, profit margins, and regional performance.


🛠️ Tech Stack

  • Language: Python 3.x
  • Database: MySQL
  • Libraries: Pandas, SQLAlchemy, PyMySQL, Matplotlib, Seaborn
  • Tools: VS Code, Jupyter Notebook

📂 Project Structure

Retail-Sales-SQL-Project/
│
├── data/
│   └── superstore_sales.csv     # Raw dataset
├── scripts/
│   ├── data_loader.py           # ETL Script: CSV -> MySQL
│   ├── analysis.sql             # 20+ Analytical Queries
│   └── dashboard.py             # Python Visualization Script
├── images/
│   └── (Screenshots of charts)  # Generated visual insights
├── README.md                    # Project Documentation
├── requirements.txt             # Dependencies
└── SQL_SCENARIOS.md             # Detailed breakdown of SQL queries

📈 Dashboard Insights Here are the key visualizations generated by the dashboard.py script.

1. Monthly Sales Trend

Visualizing revenue growth over time to identify seasonality.

Monthly Sales Trend

2. Sales by Category

Comparing performance across major product categories.

Sales by Category

3. Profit Distribution by Region

Understanding which regions are most profitable.

Profit Distribution by Region


🚀 How to Run

  1. Clone the repository from GitHub:
git clone https://github.com/sanaurrehmanarain/Retail-Sales-Analytics-SQL.git
  1. Install dependencies:
pip install -r requirements.txt
  1. Setup Database:

    -Create a MySQL database named sales_db.

    -Update database credentials in data_loader.py.

  2. Run the ETL Script:

python data_loader.py
  1. Visualize Data:
python dashboard.py

📧 Contact

For any questions or feedback, feel free to reach out via LinkedIn.

About

End-to-End Data Analytics project extracting raw retail data via Python, loading it into MySQL for complex SQL analysis, and visualizing actionable business insights (Sales Trends, Profit Margins) using Matplotlib & Seaborn.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors