Live · PostgreSQL in your browser

E-Commerce Analytics Dashboard

A simulated online retailer analyzed end-to-end in PostgreSQL. The charts below are real outputs from 10 analytical SQL queries — revenue trends, RFM segmentation, cohort retention, churn, and lifetime value. Scroll down to run the queries yourself against a full Postgres database running entirely in your browser (no server).

The Results
What the data says
Monthly revenue & returns
Net revenue per month with returns overlaid — the holiday spike (Nov–Dec) is unmistakable, and the business grows year over year.

      
Customer segments (RFM)
Customers scored on Recency, Frequency & Monetary value, then bucketed. "Champions" are a fraction of buyers but most of the revenue.

      
Revenue by department
Leaf-level sales rolled up the category tree to top-level departments via a recursive CTE.

      
Year-over-year growth by category
Revenue per category for 2022–2024, pivoted wide with conditional aggregation.

      
Lifetime value by acquisition channel
Average LTV by the channel that first acquired each customer — where marketing dollars pay off.

      
Top products (Pareto)
The best-selling products by revenue, with a cumulative % line testing the 80/20 rule.

      
Quarterly churn rate
Share of active customers who did not return the following quarter.

      
Cohort retention
Of customers who first ordered in a given month, what % came back N months later? Darker = higher retention.

      
Interactive
Run SQL against a live database

This loads a real PostgreSQL 16 engine (compiled to WebAssembly) directly in your browser, builds the schema, and generates ~57,000 rows of data — then you can query it. Nothing is sent to a server.

Database not started

Tip: tables live in the shop schema (search_path is set for you). Try SELECT * FROM products LIMIT 20;