Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🛒 SQL Retail Sales Analysis

📌 Overview

This project analyzes retail sales data using SQL to answer real-world business questions and generate actionable insights. The project demonstrates data cleaning, data exploration, aggregation, filtering, grouping, and advanced SQL techniques to support business decision-making.

The objective is to transform raw transactional data into meaningful insights that help businesses understand customer behavior, sales performance, and product trends.


🎯 Project Objectives

  • Clean and prepare retail sales data.
  • Explore customer and transaction data.
  • Solve real-world business problems using SQL.
  • Generate actionable business insights.
  • Demonstrate SQL skills used by Data Analysts.

❓ Business Questions Answered

  1. Retrieve all sales made on a specific date.
  2. Find Clothing transactions with quantity greater than or equal to 4 during November 2022.
  3. Calculate total sales for each product category.
  4. Find the average age of customers purchasing Beauty products.
  5. Retrieve transactions where total sales exceed 1000.
  6. Count total transactions by gender within each category.
  7. Calculate monthly average sales and identify the best-selling month of each year.
  8. Identify the Top 5 customers based on total sales.
  9. Count unique customers for each product category.
  10. Categorize orders into Morning, Afternoon, and Evening shifts and determine the number of orders in each shift.

📊 Project Workflow

1. Database Creation

  • Created a SQL database.
  • Created the retail_sales table.
  • Imported retail sales data using BULK INSERT.

2. Data Cleaning

  • Checked for missing values.
  • Removed incomplete records.
  • Verified data quality before analysis.

3. Data Exploration

  • Calculated total sales records.
  • Identified unique customers.
  • Explored the dataset before analysis.

4. Business Analysis

Used SQL queries to answer business questions and uncover insights about:

  • Sales performance
  • Customer demographics
  • Product categories
  • Revenue trends
  • Customer purchasing behavior
  • Sales by time period

📈 Key Insights

  • Identified top-performing product categories.
  • Analyzed customer demographics.
  • Determined highest-value customers.
  • Evaluated monthly sales performance.
  • Compared sales across categories.
  • Measured customer distribution by category.
  • Analyzed purchasing patterns based on transaction time.

💼 Business Value

The insights generated from this project can help businesses:

  • Identify high-performing product categories.
  • Understand customer purchasing behavior.
  • Improve sales strategies.
  • Target valuable customers.
  • Optimize inventory planning.
  • Support data-driven business decisions.

🛠️ Technologies Used

  • SQL Server
  • SQL

📚 SQL Concepts Applied

  • SELECT
  • WHERE
  • ORDER BY
  • GROUP BY
  • Aggregate Functions
  • COUNT()
  • SUM()
  • AVG()
  • ROUND()
  • CASE Statements
  • Date Functions
  • DISTINCT
  • Data Cleaning
  • Data Exploration

📂 Repository Structure

sql-retail-sales-analysis/
│
├── README.md
├── sql_query_p1.sql
└── retail_sales.csv

🎯 Skills Demonstrated

  • SQL
  • Data Cleaning
  • Data Exploration
  • Business Analytics
  • Data Analysis
  • Aggregation
  • Filtering
  • Query Optimization
  • Problem Solving

🚀 Future Improvements

  • Build an interactive Power BI dashboard using the SQL dataset.
  • Perform trend forecasting using Python.
  • Develop advanced SQL reports with Window Functions and CTEs.
  • Automate reporting using stored procedures.

👩‍💻 Author

Ayesha Ijaz

Computer Science Graduate | Data Analyst

Skills

  • SQL
  • Python
  • Power BI
  • Microsoft Excel
  • Data Analysis
  • Business Intelligence
  • Dashboard Development

⭐ Support

If you found this project helpful, consider giving this repository a ⭐.

Feedback and suggestions are always welcome!

About

Sql Retail Sales Analysis | Data Cleaning, Business Analysis, Customer Insights & Sales Analytics

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors