📊 Business Intelligence Report

ECommerce
Ultra DB
Analytics

A comprehensive analysis of 10,000 orders, 500 customers, and $6.39M in revenue — built on SQL Server & analyzed with Python.

$6.39MTotal Revenue
10,000Orders
500Customers
15Products
Return Rate
0.33%
Avg Delivery
1.60 days
Support Res.
9.91 hrs
👥 The Team Behind the Project

Meet Our Team

ECommerce Ultra DB — Data Analysis & Engineering Project

A
Ahmed Abd El-Hafez Mohamed
Data Engineer
A
Ahmed Khaled Gamal
SQL Developer
A
Ahmed Mostafa Abd El-Salam
Data Analyst
I
Ibrahim Ahmed Atya
Database Designer
A
Ahmed Khaled El-Feky
BI Analyst
DB
SQL PHASE 01 — DATABASE DESIGN

Tables Creation Script

SQL Server · T-SQL
ECommerce_Ultra_DB.sql
-- ══ Create & Use Database ══ CREATE DATABASE ECommerce_Ultra_DB; USE ECommerce_Ultra_DB; -- ══ Core Lookup Tables ══ CREATE TABLE Categories ( CategoryID INT PRIMARY KEY, CategoryName NVARCHAR(50) ); CREATE TABLE Suppliers ( SupplierID INT PRIMARY KEY, SupplierName NVARCHAR(50), City NVARCHAR(50) ); -- ══ Customers Table ══ CREATE TABLE Customers ( ID INT PRIMARY KEY, Name NVARCHAR(100), Email NVARCHAR(100), Phone NVARCHAR(20), City NVARCHAR(50), Gender NVARCHAR(10), Age INT, RegistrationDate DATE DEFAULT GETDATE() ); -- ══ Products Table ══ CREATE TABLE Products ( ProductID INT PRIMARY KEY, SKU NVARCHAR(50) UNIQUE, ProductName NVARCHAR(100), CategoryID INT FOREIGN KEY REFERENCES Categories(CategoryID), SupplierID INT FOREIGN KEY REFERENCES Suppliers(SupplierID), Price DECIMAL(10,2), StockQuantity INT ); -- ══ Orders & OrderItems ══ CREATE TABLE Orders ( OrderID INT PRIMARY KEY, CustomerID INT FOREIGN KEY REFERENCES Customers(ID), OrderDate DATE, TotalAmount DECIMAL(10,2), Status NVARCHAR(20) ); CREATE TABLE OrderItems ( OrderItemID INT IDENTITY(1,1) PRIMARY KEY, OrderID INT FOREIGN KEY REFERENCES Orders(OrderID), ProductID INT FOREIGN KEY REFERENCES Products(ProductID), Quantity INT, LineTotal DECIMAL(10,2) );
🗄️
Total Tables
10
Fully normalized schema
🔑
Primary Keys
10
One per table
🔗
Foreign Keys
9
Referential integrity enforced
💡 Design Pattern
Star-schema inspired: Orders as fact table, surrounded by Customers, Products, Payments, Shipping dimension tables.
SQL PHASE 02 — DATA GENERATION

Realistic Data Generation Logic

10,000 Orders · WHILE Loops
data_generation.sql — 10,000 Orders Loop
-- ══ Generate 500 Customers with randomized data ══ DECLARE @c INT = 1; WHILE @c <= 500 BEGIN DECLARE @City NVARCHAR(50) = CASE WHEN ABS(CHECKSUM(NEWID())) % 100 < 40 THEN 'New York, NY' WHEN ... < 70 THEN 'Los Angeles, CA' WHEN ... < 90 THEN 'Chicago, IL' ELSE 'Miami, FL' END; INSERT INTO Customers VALUES (...); SET @c = @c + 1; END -- ══ Generate 10,000 Orders with items & payments ══ DECLARE @o INT = 1; WHILE @o <= 10000 BEGIN DECLARE @Status NVARCHAR(20) = CASE WHEN @rand < 80 THEN 'Delivered' WHEN @rand < 95 THEN 'Cancelled' ELSE 'Processing' END; -- Insert 1–3 items per order DECLARE @NumItems INT = 1 + (ABS(CHECKSUM(NEWID())) % 3); WHILE @i <= @NumItems BEGIN INSERT INTO OrderItems (OrderID,ProductID,Quantity,LineTotal) VALUES (@o, @ProdID, @Qty, @Qty * @Price); END -- Auto-generate matching payment record INSERT INTO Payments VALUES ( @o, @PayMethod, CASE WHEN @Status='Cancelled' THEN 'Refunded' ELSE 'Completed' END, @OrderDate, @TotalAmount ); -- Auto-generate shipping for delivered/processing IF @Status IN ('Delivered', 'Processing') INSERT INTO Shipping VALUES (@o, @ShipDate, @DelivDate, @Carrier, @Status); -- 5% chance of return for delivered orders IF @Status = 'Delivered' AND @rand < 5 INSERT INTO Returns VALUES (...); SET @o = @o + 1; END -- ══ Generate 800 Support Tickets ══ DECLARE @t INT = 1; WHILE @t <= 800 BEGIN INSERT INTO SupportTickets VALUES ( @CustID, CASE WHEN @pri < 20 THEN 'High' WHEN @pri < 60 THEN 'Medium' ELSE 'Low' END, @CreatedAt, @ClosedAt, 'Closed' ); SET @t = @t + 1; END PRINT 'DATABASE CREATED SUCCESSFULLY!';
🔄
Orders Loop
10,000
Iterations with nested items
👥
Customers Loop
500
Randomized per iteration
🎫
Tickets Loop
800
3 priority levels
📦
Total Rows Generated
49,893
Across all 10 tables
⚙️ Key Techniques
CHECKSUM(NEWID()) for randomness · WHILE loops for bulk generation · CASE WHEN for realistic distribution · AUTO-CASCADE logic for Payments & Shipping
EDA 01 — DATABASE STRUCTURE

Database Schema

10 Tables · Referential Integrity
📋 Customers 500 rows
PK ID · Name · Email · Phone
Address · City · Gender · Age
RegistrationDate
🛒 Orders 10,000 rows
PK OrderID
FK CustomerID · OrderDate
TotalAmount · Status
📦 OrderItems 19,979 rows
PK OrderItemID
FK OrderID · ProductID
Quantity · LineTotal
🏷️ Products 15 rows
PK ProductID · SKU
FK CategoryID · SupplierID
Price · StockQuantity
💳 Payments 10,000 rows
PK PaymentID
FK OrderID · PaymentMethod
Status · AmountPaid
🚚 Shipping 8,581 rows
PK ShipmentID
FK OrderID · Carrier
ShippedDate · DeliveredDate
↩️ Returns 33 rows
PK ReturnID
FK OrderID · ProductID
Reason · RefundAmount
🎫 SupportTickets 800 rows
PK TicketID
FK CustomerID · Priority
CreatedAt · ClosedAt · Status
🏭 Suppliers 3 rows
PK SupplierID · SupplierName
City
Tech Giant · Fashion Ave · Home Basics
EDA 02 — EXECUTIVE SUMMARY

Key Performance Indicators

2025 – 2026
💰$6,392,434Total RevenueAll-time
🛒10,000Total Orders19,979 items
👥500Customers4 cities
🎫800Support Tickets100% closed
$5,483,003Payments Completed85.8%
↩️$909,431Refunded14.2%
🚚8,581Total Shipments1.60 avg days
📦33Total Returns0.33% rate
EDA 03 — REVENUE TREND

Monthly Revenue Trend

2025 – 2026 · Line Chart
🏆
Peak Month
$559,449
November 2025
📅
Dec 2025
$538,111
Strong Q4
📈
Jan 2026
$531,495
Sustained momentum
📊
Feb 2026
$502,193
Seasonal dip
Monthly Revenue by Year (2025 vs 2026)
Total Sales ($) — grouped by month
EDA 04 — CATEGORY ANALYSIS

Revenue by Category

4 Categories · LineTotal
Category Revenue Distribution
Total LineTotal per category — Donut
Electronics$4,331,476
Home & Kitchen$957,434
Clothing$666,594
Beauty$436,930
Top 5 Products by Quantity Sold
Items sold across all orders
EDA 05 — LOGISTICS

Shipping & Carriers

8,581 Shipments
Average Delivery Time (Days)
FedEx & UPS: 1 day · USPS: 4 days
Shipping Status Breakdown
Delivered 8,096 · In Transit 485
📦
Total Shipments
8,581
Delivered
8,096
94.3% success rate
⏱️
Overall Avg Delivery
1.60 days
⚠️ ATTENTION
USPS is 4× slower than FedEx/UPS. Reducing USPS allocation can significantly improve customer experience.
EDA 06 — PAYMENT ANALYSIS

Payment Methods & Status

10,000 Transactions
Most Popular Payment Methods
Credit Card 6,510 · PayPal 2,464 · Cash 1,026
Payment Status by Value
Completed $5,483,003 (85.8%) · Refunded $909,431 (14.2%)
💳6,510Credit Card
🅿️2,464PayPal
💵1,026Cash
85.8%Completion Rate
EDA 07 — CUSTOMERS

Geography & Demographics

500 Customers · 4 Cities
Top Cities by Revenue
TotalAmount grouped by customer city
#CityRevenueShare
01New York, NY$6,080,23240.1%
02Los Angeles, CA$4,669,99730.8%
03Chicago, IL$2,608,80817.2%
04Miami, FL$1,575,79610.4%
Revenue by City
Sales by Gender
Female 51% · Male 49%
Sales by Age Group
46–60 age group leads in spending
EDA 08 — RETURNS & SUPPORT

Returns & Customer Support

33 Returns · 800 Tickets
33
Total Returns — 0.33% Return Rate (Excellent!)
Top Reasons for Returns
Count per return reason
Returns by Category
Beauty leads with 16 returns
Support Tickets Performance
800 tickets · All Closed · Avg 9.91 hrs
Total Tickets
800
All Status
Closed
Avg Resolution
9.91 hrs
High Priority
9.915 hrs
EDA 09 — SUPPLY CHAIN

Suppliers & Stock Status

3 Suppliers · 15 Products
Sales Contribution by Supplier
Total LineTotal — Tech Giant dominates at 67.8%
🏢Tech Giant$4,331,476
👗Fashion Ave$1,103,524
🏠Home Basics$957,434
⚠️ Low Stock Alert — Order Priority
Products requiring immediate restock
4K Smart TV 55"
50CRITICAL
Espresso Machine
60CRITICAL
MacBook Air M2
80LOW
Ceramic Cookware Set
90MONITOR
Men Slim Fit Suit
100OK
EDA 10 — TOP CUSTOMERS & BUNDLES

VIP Customers & Product Bundles

Top 10 Spenders
👑
# 01 · VIP
Mary Smith
Customer #115
Total Spent
$23,316
🥈
# 02 · VIP
Linda Williams
Customer #417
Total Spent
$22,989
🥉
# 03 · VIP
Mary Smith
Customer #475
Total Spent
$22,887
# 04 · VIP
Elizabeth Jones
Customer #149
Total Spent
$21,868
# 05 · VIP
James Smith
Customer #60
Total Spent
$21,859
🛍️ Top Product Bundles (Market Basket Analysis)
1
Espresso Machine + Ceramic Cookware Set
142
times
2
Luxury Perfume + Hair Dryer Pro
141
times
3
AirPods Pro + Luxury Perfume
136
times
4
Ceramic Cookware Set + Hair Dryer Pro
136
times
5
Running Shoes + Air Fryer XXL
136
times
# 06–10 VIPs
Jennifer Johnson #381 — $21,746
Mary Smith #335 — $21,419
Mary Smith #205 — $21,419
Elizabeth Jones #459 — $21,084
Michael Brown #488 — $21,042
💡 Opportunity
Bundle promotions can increase AOV. VIP loyalty program can retain top spenders.
EDA 11 — INSIGHTS

Key Recommendations

8 Actionable Insights
01
Double down on Electronics67.8% of revenue ($4.33M). Prioritize inventory, marketing & product expansion.
02
Launch Bundle PromotionsEspresso Machine + Cookware co-purchased 142×. Bundles can boost average order value.
03
Reduce USPS DependencyUSPS: 4 days vs FedEx/UPS: 1 day. Routing to faster carriers improves experience.
04
Urgent Restock: 4K TV & Espresso4K Smart TV (50 units) and Espresso Machine (60 units) are critically low in stock.
05
Target 46–60 Age GroupHighest spending segment. Premium campaigns and loyalty offers can increase spend further.
06
Investigate 14.2% Refund Rate$909,431 in refunds from cancelled orders — significant revenue recovery opportunity.
07
Launch VIP Loyalty ProgramTop 10 customers each spend $21K+. A tiered rewards program retains high-value clients.
08
Address Beauty Returns (48.5%)16 of 33 returns are Beauty — mostly "Changed My Mind". Better product pages can help.
🎓

Thank You

This concludes our ECommerce Ultra DB analysis.
From SQL database design to full exploratory data analysis — we hope this report delivers meaningful business insights.

Ahmed Abd El-Hafez Ahmed Khaled Gamal Ahmed Mostafa Ibrahim Ahmed Atya Ahmed Khaled El-Feky