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.
- 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.
- PostgreSQL
- SQL
- Microsoft Excel (Source Dataset)
- pgAdmin
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.
- Imported the Excel retail sales dataset into PostgreSQL.
- Created the required database table.
- Loaded the dataset for analysis.
Performed data quality checks by:
- Identifying NULL values
- Removing incomplete records
- Validating data consistency
- Ensuring clean and reliable data
Explored the dataset to understand:
- Total transactions
- Customer demographics
- Product categories
- Sales distribution
- Customer purchasing patterns
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
- SELECT
- WHERE
- ORDER BY
- GROUP BY
- HAVING
- COUNT()
- SUM()
- AVG()
- DISTINCT
- Aggregate Functions
- Date Functions
- Conditional Filtering
- Data Cleaning
Retail-Sales-Analysis-using-PostgreSQL/
│
├── Retail Sales Analysis PostgreSQL.sql
├── SQL - Retail Sales Analysis_utf.csv
├── Screenshots Sales.sql
└── README.md
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
- PostgreSQL
- SQL Query Writing
- Data Cleaning
- Exploratory Data Analysis (EDA)
- Business Analytics
- Excel Data Import
- Aggregate Functions
- Data Validation
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
- 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
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.