E-Commerce Analytics

SQL Case Study

an abstract photo of a curved building with a blue sky in the background

Overview

This project analyzes transactional data from an e-commerce marketplace to evaluate revenue growth, customer purchasing behavior, and retention patterns.
Using PostgreSQL and SQL, I designed an analytics-ready data model and conducted end-to-end analysis to identify what drives revenue and where growth opportunities exist.

Tools: PostgreSQL • SQL • Data Modeling • Cohort Analysis • RFM Segmentation

Problem

Marketplace growth alone does not indicate business health. Stakeholders needed clarity on:

  • Is revenue growing sustainably?

  • Are customers returning after their first purchase?

  • What products and customers generate most revenue?

  • Where should the business focus to improve performance?

Approach

The project followed a structured analytical workflow:

  • Built a star schema analytics model from raw transactional data

  • Validated data quality and relationships before analysis

  • Analyzed revenue trends and customer purchasing patterns

  • Performed cohort analysis to measure retention

  • Segmented customers using RFM methodology

Key insights

  • Growth is primarily driven by new customer acquisition, not retention.

  • ~97% of customers make only one purchase.

  • Average basket size is low (~1.14 items), indicating mission-based shopping.

  • A small subset of products generates a large share of revenue.

  • High-value customers are frequently becoming inactive (“at risk”).

Recommendations

  • Focus on retention rather than acquisition alone.

  • Introduce engagement campaigns within 60–90 days after purchase.

  • Target high-value at-risk customers with reactivation strategies.

  • Encourage multi-item purchases through bundling and promotions.

What this project demonstrates

  • End-to-end analytical thinking

  • SQL-driven business analysis

  • Data modeling for analytics

  • Translating data into actionable decisions