Skip to content

Advanced SQL project analyzing e-commerce sales using joins, CTEs, and window functions. Includes sample data (CSV) and queries with business insights.

Notifications You must be signed in to change notification settings

NidhiDevrani/SQL-Ecommerce-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š SQL Project – E-commerce Sales Analysis

πŸ“… Date: [August, 2025]


πŸ“Œ Project Overview

This project analyzes sales data from a small e-commerce platform using SQL.
The goal is to demonstrate advanced SQL skills such as joins, aggregations, CTEs, and window functions to extract meaningful business insights.


πŸ“‚ Datasets

  • Customers_data.csv β†’ Customer details (ID, name, city, signup date)
  • Products_data.csv β†’ Product details (ID, name, category, price)
  • Orders_data.csv β†’ Orders placed by customers (ID, product, quantity, date)

πŸ› οΈ Skills Demonstrated

  • SQL Joins (INNER JOIN, aggregations)
  • Common Table Expressions (CTEs)
  • Window Functions (RANK, Running Totals)
  • Business-Oriented Query Writing
  • Data Analysis & Reporting

πŸ” Example Business Questions Answered

  1. Who are the top spending customers across all cities?
  2. Which cities contribute the most to total revenue
  3. What are the daily sales trends and cumulative growth over time?
  4. Which customers shop across multiple product categories?
  5. What are the most popular products in each city?
  6. Which product categories drive the most revenue? (extra since you have more categories now)

πŸ“Š Key Insights

  • πŸ† Top Customers: Ava Sharma, Ananya Iyer, and Rahul Mehta are the highest spenders.
  • πŸŒ† Top Cities: Mumbai and Delhi generate the most revenue overall.
  • πŸ“ˆ Sales Trends: Daily sales are steady with cumulative revenue showing consistent growth.
  • πŸ›οΈ Multi-Category Buyers: 8 customers shop across multiple categories, led by Ava Sharma.
  • πŸ™οΈ Popular Products by City: Laptops dominate Mumbai, Smartphones lead Delhi, T-Shirts top Bangalore.
  • πŸ“¦ Category Revenue: Electronics contribute ~55% of revenue, making them the main driver.

πŸ“ Files in this Repository

  • Customers_data.csv
  • Products_data.csv
  • Orders_data.csv
  • SQL_queries.sql
  • README.md (this file)

πŸš€ How to Use

  1. Import the CSVs into your SQL database (PostgreSQL, MySQL, or SQLite).
  2. Run queries from SQL_queries.sql.
  3. Explore insights or modify queries to extend the analysis.

✨ Author

Nidhi Devrani

About

Advanced SQL project analyzing e-commerce sales using joins, CTEs, and window functions. Includes sample data (CSV) and queries with business insights.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published