Skip to content

About

The project covers the complete workflow from importing raw Excel data into PostgreSQL to performing data cleaning, exploratory data analysis (EDA), and generating business insights through SQL.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

📊 Retail Sales Analysis using PostgreSQL

📌 Project Overview

This project demonstrates a complete Retail Sales Analysis using PostgreSQL and Microsoft Excel. The objective is to analyze retail transaction data, clean and prepare the dataset, and answer real-world business questions using SQL.

The project covers the complete workflow from importing raw Excel data into PostgreSQL, performing data cleaning, exploratory data analysis (EDA), and generating business insights using SQL queries.


🎯 Project Objectives

  • Import retail sales data from an Excel dataset into PostgreSQL.
  • Perform data cleaning and validation.
  • Explore customer purchasing behavior.
  • Analyze sales trends using SQL.
  • Generate actionable business insights.

🛠️ Technology Used

  • PostgreSQL
  • SQL
  • Microsoft Excel (Source Dataset)
  • pgAdmin

📂 Dataset

The dataset contains retail transaction records including:

  • Transaction ID
  • Sale Date
  • Sale Time
  • Customer ID
  • Gender
  • Age
  • Product Category
  • Quantity
  • Price Per Unit
  • Cost of Goods Sold (COGS)
  • Total Sale

The source dataset was maintained in Microsoft Excel and imported into PostgreSQL for analysis.


🔄 Project Workflow

Step 1 – Data Import

  • Imported the Excel retail sales dataset into PostgreSQL.
  • Created the required database table.
  • Loaded the dataset for analysis.

Step 2 – Data Cleaning

Performed data quality checks by:

  • Identifying NULL values
  • Removing incomplete records
  • Validating data consistency
  • Ensuring clean and reliable data

Step 3 – Exploratory Data Analysis (EDA)

Explored the dataset to understand:

  • Total transactions
  • Customer demographics
  • Product categories
  • Sales distribution
  • Customer purchasing patterns

Step 4 – Business Analysis

Solved various business problems using SQL, including:

  • Sales made on a specific date
  • Category-wise sales analysis
  • High-value transactions
  • Monthly sales trends
  • Average customer age by category
  • Best-performing product categories
  • Customer purchasing behavior

📊 SQL Concepts Used

  • SELECT
  • WHERE
  • ORDER BY
  • GROUP BY
  • HAVING
  • COUNT()
  • SUM()
  • AVG()
  • DISTINCT
  • Aggregate Functions
  • Date Functions
  • Conditional Filtering
  • Data Cleaning

📁 Repository Structure

Retail-Sales-Analysis-using-PostgreSQL/
│
├── Retail Sales Analysis PostgreSQL.sql
├── SQL - Retail Sales Analysis_utf.csv
├── Screenshots Sales.sql
└── README.md

📈 Key Business Insights

The analysis provides insights into:

  • Total retail transactions
  • Customer demographics
  • Product category performance
  • Monthly sales trends
  • High-value purchases
  • Average customer age by product category
  • Sales distribution across categories

🚀 Skills Demonstrated

  • PostgreSQL
  • SQL Query Writing
  • Data Cleaning
  • Exploratory Data Analysis (EDA)
  • Business Analytics
  • Excel Data Import
  • Aggregate Functions
  • Data Validation

📚 Learning Outcomes

Through this project, I gained practical experience in:

  • Importing Excel data into PostgreSQL
  • Writing optimized SQL queries
  • Cleaning and validating datasets
  • Performing business analysis using SQL
  • Generating insights from transactional retail data

📌 Future Enhancements

  • Build an interactive Power BI dashboard
  • Optimize queries using indexes
  • Create SQL Views and Stored Procedures
  • Perform advanced sales forecasting
  • Automate data import using ETL tools

👨‍💻 Author

Greeshma Pathuri

This project is part of my Data Analytics portfolio and demonstrates practical SQL skills by solving real-world retail business problems using PostgreSQL.

If you found this project helpful, feel free to ⭐ the repository.

About

The project covers the complete workflow from importing raw Excel data into PostgreSQL to performing data cleaning, exploratory data analysis (EDA), and generating business insights through SQL.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors