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
- Project Overview
- Key Features
- Project Structure
- Tech Stack
- Concepts Covered
- Analytics Queries
- Author
- β 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
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
Category | Tool/Technology |
---|---|
Database | PostgreSQL |
Language | SQL, Python |
Libraries | psycopg2, SQLAlchemy, Pandas, Matplotlib, Faker |
Tools | pgAdmin, Jupyter Notebook |
Version Control | Git & GitHub |
- 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
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