Skip to content

End-to-end sales analytics project, cleaning and processing walmart's sales data using Python (Pandas), MySQL to answer real world business questions. Designed to reflect data analytics in a practical retail environment.

Notifications You must be signed in to change notification settings

4sharu4/Walmart_Python-SQL_Business_Answers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ Walmart_Python-SQL_Business_Answers

Analyze Walmart's retail sales data end-to-end: from cleaning raw data using Python to answering business-critical questions using MySQL. This project provides actionable insights into product performance, sales volume trends, customer ratings, payment behavior, and branch efficiency.


🧠 About the Project

This is a hands-on SQL + Python analytics project using real-world Walmart data.

  • Data is cleaned and transformed using Python (pandas)
  • Key fields like sales volume, customer behavior, and profitability margins are standardized
  • Cleaned data is stored as walmart_clean.csv
  • SQL queries (MySQL) explore retail KPIs, customer trends, and branch performance

πŸ› οΈ Technologies Used

  • Python (pandas) – Data cleaning and preprocessing
  • MySQL – SQL-based analytics and business intelligence
  • Jupyter Notebook – For step-by-step Python execution
  • Kaggle Dataset – Walmart Sales Dataset

πŸ“¦ Installation & Setup

1. Clone the repository

git clone https://github.com/your-username/walmart-sales-analysis.git
cd walmart-sales-analysis

2. Install Python requirements

pip install pandas

3. Clean the dataset with Python

Run the provided Jupyter Notebook:

  • walmart_data_cleaning.ipynb This notebook performs data cleaning steps β€” handling missing values, correcting types, removing duplicates β€” and exports a clean version of the dataset as walmart_clean.csv.

4. Load data into MySQL

Create the table schema in MySQL:

CREATE TABLE walmart_clean (
    invoice_id VARCHAR(20),
    branch VARCHAR(10),
    city VARCHAR(50),
    category VARCHAR(50),
    unit_price FLOAT,
    quantity INT,
    date DATE,
    time TIME,
    payment_method VARCHAR(20),
    rating FLOAT,
    profit_margin FLOAT
);

Then import the walmart_clean.csv file using MySQL Workbench or your preferred import tool.


πŸ“Š Business Questions Answered

This project answers real-world analytics questions relevant to Walmart and retail operations:

  1. πŸ“¦ What are the top-selling categories by units sold?
  2. πŸͺ Which categories perform best at each branch?
  3. πŸ•’ What are the busiest times of day and days of the week?
  4. ⭐ Do higher-rated categories correlate with higher sales?
  5. πŸ’° Which branches are most efficient in terms of sales volume and profit margin?
  6. πŸ’³ What are the most popular payment methods and average basket size?
  7. ⚠️ Which categories are underperforming in both units and customer ratings?
  8. πŸ“† What are the monthly sales trends (seasonality)?
  9. 🧾 What is the average basket size per branch?
  10. πŸ” How are unit sales changing year-over-year by branch?

πŸ“ˆ Sample Insights

  • πŸ” Food & Beverages consistently leads in total units sold.
  • πŸ•’ Sales peak during evenings and weekends, especially in Branch B.
  • ⭐ Higher-rated categories tend to sell more units, showing a positive link between customer satisfaction and demand.
  • πŸ’³ Ewallet is the most preferred payment method across branches.
  • ⚠️ Fashion Accessories shows both low units and low ratings β€” a clear candidate for product review or promotions.
  • πŸ“† Branch C experienced a year-over-year decline in unit sales, highlighting areas needing operational focus.

πŸ“ Project Structure

πŸ“¦ walmart-sales-analysis/
β”œβ”€β”€ walmart_data_cleaning.ipynb   # Python notebook for cleaning and exporting data
β”œβ”€β”€ walmart_clean.csv             # Cleaned dataset exported from notebook
β”œβ”€β”€ queries.sql                   # MySQL queries answering business questions
└── README.md                     # This documentation

🀝 Contributing

Contributions are welcome! Fork the repo, make your changes, and open a pull request.

About

End-to-end sales analytics project, cleaning and processing walmart's sales data using Python (Pandas), MySQL to answer real world business questions. Designed to reflect data analytics in a practical retail environment.

Topics

Resources

Stars

Watchers

Forks