Skip to content

About

A Retail Sales Analysis project using MySQL to explore and analyze retail transaction data, customer purchasing behaviour, product category performance, and sales trends. Demonstrates SQL skills in data cleaning, exploratory data analysis, aggregate functions, subqueries, CTEs, and window functions to derive meaningful business insights.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🛍️ Retail Sales Analysis SQL Project

📌 Project Overview

Project Title: Retail Sales Analysis

Database: retail_db
Tools Used: MySQL Server, MySQL Workbench, SQL

This project focuses on analyzing retail sales data using SQL to uncover meaningful business insights. It demonstrates essential SQL skills used by data analysts, including database creation, data cleaning, exploratory data analysis (EDA), aggregate functions, filtering, grouping, subqueries, and window functions.

The goal is to transform raw retail sales data into useful insights that can support business decision-making.

🎯 Project Objectives

  • Database Setup: Create a database and table to store retail sales data.
  • Data Cleaning: Identify and handle missing or NULL values.
  • Exploratory Data Analysis (EDA): Explore the dataset to understand sales patterns and customer demographics.
  • Business Analysis: Answer business questions using SQL queries.
  • Insight Generation: Identify sales trends, customer purchasing behavior, and product category performance.

🗂️ Database Structure

Database Name: retail_db
Table Name: retail_sales

The retail_sales table contains the following columns:

Column Name Description
transactions_id Unique transaction identifier
sale_date Date of the transaction
sale_time Time of the transaction
customer_id Unique customer identifier
gender Customer gender
age Customer age
category Product category
quantity Quantity of products sold
price_per_unit Price per unit of the product
cogs Cost of goods sold
total_sale Total sales amount for the transaction

🛠️ Skills Demonstrated

  • Database and table creation
  • Data cleaning and NULL value handling
  • SELECT, WHERE, and ORDER BY
  • Aggregate functions: SUM(), AVG(), COUNT()
  • GROUP BY and HAVING
  • Date functions: YEAR(), MONTH(), DATE_FORMAT()
  • Subqueries and Common Table Expressions (CTEs)
  • Window functions: RANK() and PARTITION BY
  • Business problem-solving using SQL

📊 Business Questions Answered

This project explores retail sales through business-focused SQL queries, including:

  1. Retrieve all sales transactions.
  2. Identify customers who made purchases.
  3. Analyze sales by product category.
  4. Find transactions in a specific category with a minimum quantity sold.
  5. Calculate total sales and the number of orders.
  6. Identify the highest-selling product categories.
  7. Calculate the average sale for each month and find the best-performing month in each year.
  8. Analyze customer demographics and purchasing patterns.
  9. Identify top customers based on spending.
  10. Explore sales trends across different periods.

💡 Key Learnings

Through this project, I practiced writing SQL queries to clean, organize, and analyze retail sales data. I strengthened my understanding of aggregate functions, date-based analysis, subqueries, and window functions while learning how to approach business questions using data.

👩‍💻 Author

Snehal Bahalkar

Aspiring Data Analyst | SQL | MySQL | Power BI | Excel | Python

🔗 GitHub: Snehal2004


⭐ If you find this project useful, feel free to explore the repository and share your feedback.

About

A Retail Sales Analysis project using MySQL to explore and analyze retail transaction data, customer purchasing behaviour, product category performance, and sales trends. Demonstrates SQL skills in data cleaning, exploratory data analysis, aggregate functions, subqueries, CTEs, and window functions to derive meaningful business insights.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors