Skip to content

1NarendraSingh1/Walmart-Sales-Analysis-using-SQL-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Walmart-Sales-Analysis-using-SQL

🛠️ Tools and Libraries

  • MYSQL Workbench for preprocessing and data analysis
  • Generative AI/ CHAT GPT for Data Visualisation and Summary

1. Summary of Key Insights

Database & Table Creation

  • The script creates a database (WalmartSales) and a sales table containing attributes like invoice_id, branch, city, customer_type, gender, product_line, unit_price, quantity, tax_pct, total, date, time, payment, cogs, gross_margin_pct, gross_income, and rating.

2. Basic Data Exploration

  • Queries retrieve all sales records (SELECT * FROM sales;).
  • The script identifies the earliest (MIN(time)) and latest (MAX(time)) sales transactions, confirming operating hours from 10 AM to 9 PM.

3. Feature Engineering

  • Time-based features are extracted:
  • Sales transactions are categorized into Morning, Afternoon, and Evening periods.
  • A day_type column is created to classify sales as Weekday or Weekend.
  • Customer behavior analysis:
  • Sales are grouped by Customer Type, Payment Method, and Gender.

4. Sales Performance Analysis

  • Branch-wise Sales Performance: Summarizes total sales per branch.
  • Most and Least Popular Product Lines: Identifies the best- and worst-selling product categories.
  • Revenue Trends Over Time: Analyzes how revenue varies by day, week, and month.

5. Customer Insights

  • Gender-based purchasing patterns.
  • Customer rating trends to analyze service satisfaction.

6. Visualization of sales analysis

image

The bar chart illustrates sales activity across store operating hours (10 AM to 9 PM). The highest sales volume is observed in the evening hours (5 PM - 7 PM), likely due to peak shopping times.

7. Here are the visualizations for further analysis:

1. Sales by Day Type (Weekday vs. Weekend)

image

  • Sales by Day Type (Weekday vs. Weekend) – More sales occur on weekdays than weekends.

2. Sales by Customer Type

image

  • Sales by Customer Type – Sales are evenly split between Members and Normal customers.

3. Sales by Product Line

image

  • Sales by Product Line – Groceries have the highest sales, followed by Clothing and Electronics.

4. Revenue Trends Over Time

image

  • Revenue Trends Over Time – Fluctuations in revenue suggest periodic spikes, possibly due to promotions or seasonal demand.