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.
- 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.
- Retrieve all sales made on a specific date.
- Find Clothing transactions with quantity greater than or equal to 4 during November 2022.
- Calculate total sales for each product category.
- Find the average age of customers purchasing Beauty products.
- Retrieve transactions where total sales exceed 1000.
- Count total transactions by gender within each category.
- Calculate monthly average sales and identify the best-selling month of each year.
- Identify the Top 5 customers based on total sales.
- Count unique customers for each product category.
- Categorize orders into Morning, Afternoon, and Evening shifts and determine the number of orders in each shift.
- Created a SQL database.
- Created the
retail_salestable. - Imported retail sales data using
BULK INSERT.
- Checked for missing values.
- Removed incomplete records.
- Verified data quality before analysis.
- Calculated total sales records.
- Identified unique customers.
- Explored the dataset before 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
- 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.
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.
- SQL Server
- SQL
- SELECT
- WHERE
- ORDER BY
- GROUP BY
- Aggregate Functions
- COUNT()
- SUM()
- AVG()
- ROUND()
- CASE Statements
- Date Functions
- DISTINCT
- Data Cleaning
- Data Exploration
sql-retail-sales-analysis/
│
├── README.md
├── sql_query_p1.sql
└── retail_sales.csv
- SQL
- Data Cleaning
- Data Exploration
- Business Analytics
- Data Analysis
- Aggregation
- Filtering
- Query Optimization
- Problem Solving
- 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.
Ayesha Ijaz
Computer Science Graduate | Data Analyst
- SQL
- Python
- Power BI
- Microsoft Excel
- Data Analysis
- Business Intelligence
- Dashboard Development
If you found this project helpful, consider giving this repository a ⭐.
Feedback and suggestions are always welcome!