- MYSQL Workbench for preprocessing and data analysis
- Generative AI/ CHAT GPT for Data Visualisation and Summary
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.
- 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.
- 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.
- 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.
- Gender-based purchasing patterns.
- Customer rating trends to analyze service satisfaction.
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.
1. Sales by Day Type (Weekday vs. Weekend)
- Sales by Day Type (Weekday vs. Weekend) – More sales occur on weekdays than weekends.
2. Sales by Customer Type
- Sales by Customer Type – Sales are evenly split between Members and Normal customers.
3. Sales by Product Line
- Sales by Product Line – Groceries have the highest sales, followed by Clothing and Electronics.
4. Revenue Trends Over Time
- Revenue Trends Over Time – Fluctuations in revenue suggest periodic spikes, possibly due to promotions or seasonal demand.