This project demonstrates an end-to-end SQL-based analysis of an e-commerce sales dataset using PostgreSQL.
The objective is to transform raw transactional data into meaningful business insights by applying data cleaning, feature engineering, KPI analysis, customer segmentation, product analysis, and advanced SQL techniques.
- End-to-End SQL Analysis
- Data Cleaning & Validation
- Feature Engineering
- KPI Analysis
- Customer Segmentation (RFM)
- Time Series Analysis
- Window Functions
- Pareto Analysis
- Business Insights
- Business Recommendations
- Analyze overall sales performance
- Identify high-performing products and categories
- Evaluate customer purchasing behavior
- Measure regional sales performance
- Analyze discount effectiveness
- Discover profit improvement opportunities
- Generate actionable business recommendations
- PostgreSQL
- SQL
- Window Functions
- Common Table Expressions (CTEs)
- Aggregate Functions
- CASE WHEN
- Date Functions
The dataset contains e-commerce transaction records including:
- Orders
- Customers
- Products
- Categories
- Regions
- Payment Methods
- Discounts
- Sales
- Profit
- Order Dates
- Removed duplicate records
- Checked NULL values
- Validated data types
- Standardized text values
- Created enriched helper columns
- Generated Quarter column
- Created Profit Margin
- Created Discount Bucket
- Created Order Size Category
- Created High Value Order Flag
- SELECT
- WHERE
- GROUP BY
- HAVING
- ORDER BY
- CASE WHEN
- Aggregate Functions
- JOINS
- CTEs
- Window Functions
- ROW_NUMBER()
- RANK()
- DENSE_RANK()
- LAG()
- Running Total
- Market Share Analysis
- RFM Analysis
- Pareto Analysis
- KPI Analysis
- Category Analysis
- Product Analysis
- Customer Analysis
- Geographic Analysis
- Payment Method Analysis
- Discount Analysis
- Quarterly Analysis
- Time Series Analysis
- Customer Segmentation
- Profitability Analysis
- Statistical Analysis
- Goa generated the highest sales among all cities.
- Electronics recorded the highest average selling price.
- Home Decor captured the highest market share (10.72%).
- North region generated the highest sales.
- Q2 generated the highest revenue.
- A 5% discount produced the highest sales.
- Net Banking was the preferred payment method.
- Sales increased by 324% after 2023 before declining by 26.99% after 2024.
- Increase inventory before Q2.
- Expand the Home Decor category.
- Focus marketing on the North region.
- Maintain a 5% discount strategy.
- Promote high-margin products.
- Improve profitability of low-margin products.
- Reward high-value customers.
- Investigate the post-2024 sales decline.
E-Commerce-Sales-Analysis-SQL
│
├── Raw_E_Commerce_Sales_Data.csv
├── E_Commerce_Business_Analysis.sql
├── README.md
- SQL
- PostgreSQL
- Data Cleaning
- Data Validation
- Feature Engineering
- Data Analysis
- Window Functions
- Common Table Expressions (CTEs)
- Time Series Analysis
- Customer Analytics
- Business Intelligence
Jatin Patidar
- LinkedIn: https://www.linkedin.com/in/jatinpatidar09/
- GitHub: https://github.com/09jatin
- Email jatinpatidar606@gmail.com
If you found this project useful, consider giving it a ⭐ on GitHub.
Thank you for visiting this repository!