Practice

SaaS Star Schema

This track uses a simplified B2B SaaS model.

New to dimensional modeling? Read Star Schema Basics first; it explains facts, dimensions, and grain, which this page assumes.

Core entities:

  • saas_accounts (dimension: one row per account)
  • saas_subscriptions (fact, grain: one row per account per active month; this is the MRR fact)
  • saas_invoices (fact, grain: one row per invoice)

The subscription grain is the key idea: an account that pays in 8 of the 12 months has exactly 8 rows. A missing account-month is not NULL MRR. It is the absence of a row, which is how churn and reactivation gaps show up.

Schema Relationships #

  • accounts 1->many subscriptions via account_id
  • accounts 1->many invoices via account_id

There is no direct subscription-to-invoice key: reconciling the two facts happens through account_id plus date logic, exactly like in real billing systems.

Explore the Dataset #

Loading SQL editor...
Tip

Before solving KPI tasks, run quick checks:

  • count rows per table
  • check distinct account_id in each fact
  • verify no accidental duplicate joins (12 accounts should never become 96 result rows)

Next Step #