01 · AT A GLANCE
- 01
Designed and shipped a complete relational schema solo: eight tables, typed constraints, two analytical views, seven indexes.
- 02
Made history-safe pricing and soft deletion first-class schema decisions, not application afterthoughts.
- 03
Every published number is reproducible from seed CSVs, and labelled synthetic.
- STATUS
- Complete, with recorded walkthrough
- ROLE
- Sole author · schema, data, queries, documentation
02 · SYSTEM DEMONSTRATION

03 · THE PROBLEM
Commerce analytics fail quietly: discounts, returns, cancelled orders and catalogue changes all corrupt naive revenue queries. If the schema does not defend correctness, every number an analyst produces is one silent join away from being wrong.
04 · THE SYSTEM
CommerceLens is a relational commerce database: eight connected tables covering customers, products, orders, line items, promotions, shipments and returns, designed so real business questions stay one readable query away. Typed CHECKs, UNIQUE keys and foreign keys do the correctness work, and two analytical views pre-compute net revenue. I built it solo: schema design, seed data, documentation and the query set.
- Tables
- 8: customers, products, orders, order_items, promotions, promotion_products, shipments, returns
- Views
- 2 analytical fact views pre-computing net revenue
- Indexes
- 7, matched to the shipped query set
- Integrity
- Typed CHECKs, UNIQUE keys and foreign keys throughout