Skip to content

Hishamct/ecommerce-sql-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ E-commerce Analytics Management System (SQL Capstone Project)

πŸ“Œ Project Overview

This is a PostgreSQL-based E-commerce Management System.
It simulates a real-world e-commerce database with customers, products, orders, payments, and shipments, and showcases:

  • Database design with ER Diagram
  • Data generation using Python Faker
  • Advanced SQL queries for business insights
  • Stored procedures & triggers
  • Python integration with Pandas + Matplotlib for analytics

πŸ“‘ Table of Contents

  1. Project Overview
  2. Key Features
  3. Project Structure
  4. Tech Stack
  5. Concepts Covered
  6. Analytics Queries
  7. Author

πŸš€ Key Features

  • βœ… Structured normalized schema: Customers, Products, Orders, Order Items, Payments, Shipments
  • βœ… ER Diagram-based design (3NF normalization)
  • βœ… Data generated using Python Faker
  • βœ… Complex SQL queries: aggregations, joins, CTEs, window functions
  • βœ… Stored procedures & triggers for automation
  • βœ… Business-focused analytics queries
  • βœ… Python integration with Pandas & Matplotlib for visualization
  • βœ… Organized GitHub project structure

πŸ“‚ Project Structure

Ecommerce Database Project

ecommerce-sql-project/ │── README.md # Project overview │── sql/ β”‚ β”œβ”€β”€ create_tables.sql # Table creation scripts β”‚ β”œβ”€β”€ insert_data.sql # Insert queries (optional if using CSVs) │── data/ β”‚ β”œβ”€β”€ customers.csv β”‚ β”œβ”€β”€ products.csv β”‚ β”œβ”€β”€ orders.csv β”‚ β”œβ”€β”€ order_items.csv β”‚ β”œβ”€β”€ payments.csv β”‚ β”œβ”€β”€ shipments.csv │── queries/ β”‚ β”œβ”€β”€ analysis_queries.sql # Business insights queries β”‚ β”œβ”€β”€ stored_procedures.sql # Functions & procedures β”‚ β”œβ”€β”€ triggers.sql # Trigger functions │── notebooks/ β”‚ β”œβ”€β”€ data_generation.ipynb # Jupyter notebook for Faker dataset β”‚ β”œβ”€β”€ db_connection.py # Python + SQLAlchemy connection β”‚ β”œβ”€β”€ analysis.ipynb # Python visualization with matplotlib │── er_diagram.png # ER diagram of database │── .gitignore


πŸ› οΈ Tech Stack

Category Tool/Technology
Database PostgreSQL
Language SQL, Python
Libraries psycopg2, SQLAlchemy, Pandas, Matplotlib, Faker
Tools pgAdmin, Jupyter Notebook
Version Control Git & GitHub

πŸ“˜ Concepts Covered

  • Relational DB design & normalization (up to 3NF)
  • Foreign key constraints and integrity
  • Stored procedures & triggers
  • Advanced SQL: joins, aggregates, CTEs, window functions
  • Business-focused analytics (customer behavior, revenue trends, product performance)
  • Query tuning with EXPLAIN ANALYZE
  • Python integration for querying & visualization

πŸ“Š Analytics Queries

Located in queries/analysis_queries.sql.
Covers:

  • Monthly revenue trend
  • Top 5 best-selling products
  • Revenue by payment mode
  • Customers with highest lifetime value
  • Orders with delayed shipments
  • Repeat customers vs. one-time buyers

πŸ‘€ Author

Hisham C T Aspiring Data Scientist | SQL & Python Enthusiast

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published