RETAIL SALES ANALYSIS (SQL PROJECT)
PROJECT OVERVIEW
This project focuses on analyzing retail sales data using SQL. The goal is to clean the dataset, explore key insights, and answer critical business questions such as customer behavior, sales trends, best-selling categories & products, and seasonal and time-based patterns.
DATASET
The project assumes a table named retail_sales with the following columns:
transaction_idsale_datesale_timecustomer_idgenderagecategoryquantiy(typo in script; should bequantity)price_per_unitcogstotal_sale
STEPS PERFORMED
1. DATA CLEANING
- Checked for missing values (
NULL) in key fields. - Removed rows with incomplete data.
2. EXPLORATORY DATA ANALYSIS
- Total number of sales
- Unique customers
- Distinct product categories
3. BUSINESS & DATA ANALYSIS SQL queries were written to solve business problems, including:
- Sales made on a specific date (
2022-11-05). - Transactions of Clothing items with quantity ≥ 4 in Nov-2022.
- Total sales and number of orders for each category.
- Average age of customers in the Beauty category.
- Transactions with
total_sale > 1000. - Number of transactions by gender and category.
- Average monthly sales and best-selling month per year.
- Top 5 customers by sales.
- Unique customers per category.
- Sales by shift (Morning, Afternoon, Evening).
- Peak sale times each day.
- Common best-selling days across 2022 and 2023.
INSIGHTS YOU CAN DERIVE
- Which category contributes most to sales.
- Which customers are most valuable.
- Time of day when sales peak.
- Seasonal trends and recurring best-selling days.
HOW TO USE (SQL)
- Import your dataset into a database (e.g., PostgreSQL, MySQL).
- Run the SQL scripts in
RETAIL_sales_analysis.sql. - Modify queries as needed for your database engine (some syntax may vary).
NOTES (SQL)
- Replace
quantiywithquantityif your dataset uses the correct spelling. - The script is optimized for PostgreSQL functions (
TO_CHAR,EXTRACT), but can be adapted to MySQL or other SQL engines.
RETAIL SALES ANALYSIS DASHBOARD (POWER BI)
OVERVIEW This dashboard was developed in Power BI to visually represent the insights gained from the SQL retail sales analysis. It transforms raw data into an interactive interface that highlights trends, patterns, and key business metrics.
FEATURES
- Sales Overview: Displays total sales, total orders, and revenue trends.
- Category Performance: Identifies best-performing product categories and their share in total revenue.
- Customer Insights: Showcases top customers, unique buyers, and demographic breakdowns.
- Time-Based Analysis: Reveals sales distribution across days, months, years, and shifts (morning, afternoon, evening).
- Peak Sales Trends: Highlights recurring best-selling days across years.
PURPOSE The dashboard complements the SQL analysis by providing a visual and interactive layer. It is designed for business users to quickly explore:
- Which categories and customers drive growth
- When sales are at their highest
- Where opportunities exist for improvement
HOW TO USE (POWER BI)
- Open the
RETAILSALE_VISUALS.pbixfile in Power BI Desktop. - Connect the dashboard to your retail sales dataset if needed.
- Interact with the visuals by filtering and drilling down for deeper insights.
NOTES (POWER BI)
- The dashboard is based on the same dataset as the SQL project.
- It is meant for demonstration and learning purposes, but can be adapted to real business use cases.