Skip to content

sanjay2449/Retail-Sales-Analysis-using-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

🛍️ Retail Sales Analysis using SQL

An end-to-end SQL data analysis project built with PostgreSQL to analyze retail sales data and generate business insights through SQL queries.

PostgreSQL SQL Status


📌 Project Overview

This project demonstrates how SQL can be used to analyze retail transaction data and solve real-world business problems.

Using PostgreSQL, the project covers the complete data analysis workflow, including data cleaning, exploratory data analysis (EDA), and business reporting to extract meaningful insights from raw sales data.


🎯 Objectives

  • Design a retail sales database
  • Clean and validate transaction data
  • Perform exploratory data analysis
  • Solve business problems using SQL
  • Generate actionable business insights

🛠 Tech Stack

  • PostgreSQL
  • SQL
  • pgAdmin 4

📂 Dataset

The dataset contains retail transaction records including:

  • Transaction ID
  • Sale Date & Time
  • Customer ID
  • Gender
  • Age
  • Product Category
  • Quantity
  • Price Per Unit
  • COGS
  • Total Sales

📊 Project Workflow

Raw Sales Dataset
        │
        ▼
Database Creation
        │
        ▼
Data Cleaning
        │
        ▼
Exploratory Data Analysis
        │
        ▼
Business Analysis
        │
        ▼
Business Insights

💼 Business Questions Solved

The project answers business questions such as:

  • Daily sales analysis
  • Category-wise revenue analysis
  • Customer demographic analysis
  • High-value transaction identification
  • Gender-wise purchasing behavior
  • Best-selling month analysis
  • Top 5 customers by revenue
  • Unique customers by category
  • Shift-wise sales analysis

🧠 SQL Concepts Used

  • SELECT
  • WHERE
  • ORDER BY
  • GROUP BY
  • HAVING
  • Aggregate Functions
  • CASE WHEN
  • DISTINCT
  • Common Table Expressions (CTEs)
  • Window Functions
  • RANK()
  • Date Functions
  • Data Cleaning

📈 Key Insights

  • Identified top-performing product categories.
  • Analyzed customer purchasing behavior across demographics.
  • Detected high-value sales transactions.
  • Identified seasonal sales trends.
  • Ranked top customers by revenue.
  • Compared sales performance across different shopping shifts.

📁 Repository Structure

Retail-Sales-Analysis-SQL/
│
├── Retail-Sales-Analysis-SQL-Project.sql
├── README.md

🚀 Skills Demonstrated

  • SQL
  • PostgreSQL
  • Data Cleaning
  • Exploratory Data Analysis (EDA)
  • Business Analytics
  • Window Functions
  • Query Optimization
  • Relational Database Design

📌 Future Improvements

  • Build an interactive Power BI dashboard
  • Connect PostgreSQL with Power BI
  • Create SQL Views
  • Implement Stored Procedures
  • Perform advanced sales forecasting

⭐ If you found this project useful, consider giving it a Star.

About

An end-to-end SQL Data Analysis project demonstrating database creation, data cleaning, exploratory data analysis (EDA), and business insights using retail sales data.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors