Mizan Cloud SaaS
Mizan Cloud (fictional) · 7 tables · 67,088 rows · version 1
About 600 customer accounts that signed up between January 2023 and December 2025, their users, every subscription row (trials, paid plans, upgrades, downgrades, cancellations and reactivations), invoices, roughly 50,000 product events and support tickets. Built for cohort retention, churn, MRR, funnel and product-usage analysis. Amounts are in SAR.
The documentation is open to everyone. Querying this dataset in the playground is included with Formula Quest membership; lessons that use it follow their own access.
Relationships
Sample queries
SELECT date_trunc('month', created_at)::date AS signup_month,
acquisition_channel,
count(*) AS accounts
FROM accounts
WHERE NOT is_test_account
GROUP BY 1, 2
ORDER BY 1, 2;SELECT p.plan_name, count(*) AS subscriptions, sum(s.mrr) AS mrr
FROM subscriptions s
JOIN plans p ON p.plan_id = s.plan_id
JOIN accounts a ON a.account_id = s.account_id
WHERE NOT a.is_test_account
AND NOT s.is_trial
AND s.started_at <= DATE '2025-12-31'
AND (s.ended_at IS NULL OR s.ended_at > DATE '2025-12-31')
GROUP BY p.plan_name
ORDER BY mrr DESC;SELECT a.acquisition_channel,
count(*) AS trials,
count(*) FILTER (WHERE t.status = 'superseded') AS converted,
round(100.0 * count(*) FILTER (WHERE t.status = 'superseded') / count(*), 1) AS conversion_pct
FROM subscriptions t
JOIN accounts a ON a.account_id = t.account_id
WHERE t.is_trial AND t.status <> 'trialing' AND NOT a.is_test_account
GROUP BY 1
ORDER BY conversion_pct DESC;SELECT cancel_reason, count(*) AS churned_subscriptions
FROM subscriptions
WHERE status = 'cancelled' AND NOT is_trial
GROUP BY cancel_reason
ORDER BY 2 DESC;SELECT date_trunc('week', e.occurred_at)::date AS week, count(DISTINCT e.user_id) AS active_users
FROM events e
JOIN accounts a ON a.account_id = e.account_id
WHERE e.event_name = 'login' AND NOT a.is_test_account
AND e.occurred_at >= TIMESTAMP '2025-10-01'
GROUP BY 1
ORDER BY 1;Data dictionary
plans
5 rows · primary key (plan_id)Price list. Prices are list prices; what a customer actually pays is subscriptions.mrr.
| Column | Type | Null? | Key | Description |
|---|---|---|---|---|
| plan_id | integer | no | PK | Unique plan number. |
| plan_name | text | no | unique | starter, team_legacy (retired at the end of 2023), growth, business or enterprise. |
| plan_rank | smallint | no | unique | Order of plans from smallest (1) to largest (5). A move to a higher rank is an upgrade. |
| monthly_price | numeric(12,2) | no | List price per month on monthly billing, SAR. Enterprise prices are negotiated. | |
| annual_price | numeric(12,2) | no | List price per year on annual billing (10 × monthly: two months free), SAR. | |
| seat_limit | integer | yes | Maximum users included. NULL = unlimited (enterprise). | |
| is_active | boolean | no | FALSE for plans no longer sold to new customers. |
accounts
605 rows · primary key (account_id)Customer companies (one row per signup). Includes five internal test accounts that must be excluded from business metrics.
| Column | Type | Null? | Key | Description |
|---|---|---|---|---|
| account_id | integer | no | PK | Unique account number (ascending with signup time). |
| account_name | text | no | Company name (fictional). Not unique: two different companies can share a name. | |
| industry | text | no | Industry the customer operates in. | |
| company_size | text | no | Employee-count band. | |
| city | text | no | Head-office city. | |
| country | char(2) | no | ISO country code: SA, AE, KW, BH, QA or OM. | |
| created_at | timestamp | no | Signup time. Its month is the account's cohort. | |
| acquisition_channel | text | no | How the account found us: organic, paid (ads), partner, referral or sales (outbound sales team). | |
| is_test_account | boolean | no | TRUE for Mizan's own internal test and demo accounts. |
users
2,804 rows · primary key (user_id)People who can log in to an account. A user row is created when someone is invited; the matching 'signup' event is when they accepted.
| Column | Type | Null? | Key | Description |
|---|---|---|---|---|
| user_id | integer | no | PK | Unique user number. |
| account_id | integer | no | accounts.account_id | The account (company) the user belongs to. |
| full_name | text | no | User's name (fictional). | |
| text | no | unique | Login email (example.com domains). | |
| role | text | no | admin, member or viewer. Viewers cannot create reports. | |
| created_at | timestamp | no | When the user record was created (the account signup for the first user, otherwise the invitation time). | |
| deactivated_at | timestamp | yes | When an admin deactivated the user. NULL = still enabled (even if the account has churned). | |
| last_seen_at | timestamp | yes | Time of the user's latest event. NULL = never used the product (e.g. never accepted the invite). |
subscriptions
989 rows · primary key (subscription_id)Subscription history: one row per continuous period on one plan and billing cycle. Plan changes close the old row ('superseded') and open a new row the same day; trials are rows with is_trial = TRUE.
| Column | Type | Null? | Key | Description |
|---|---|---|---|---|
| subscription_id | integer | no | PK | Unique subscription row number. |
| account_id | integer | no | accounts.account_id | The customer account. |
| plan_id | integer | no | plans.plan_id | The plan for this period. |
| is_trial | boolean | no | TRUE for the free 14-day trial (mrr = 0, never invoiced). | |
| billing_cycle | text | no | monthly or annual billing. | |
| seats | integer | no | Seats purchased. | |
| mrr | numeric(12,2) | no | Monthly recurring revenue of this row in SAR, after discounts (annual contracts: yearly value / 12). | |
| started_at | date | no | First day of this row. | |
| ended_at | date | yes | Day the row stopped (exclusive: not active on this day). NULL = still running on 2025-12-31. | |
| status | text | no | trialing, active, past_due (running but unpaid), cancelled (customer left or trial expired) or superseded (replaced by a plan change or trial conversion). | |
| cancel_reason | text | yes | Why a cancelled row ended (e.g. too_expensive, low_usage, trial_expired). NULL for all other statuses. |
invoices
2,885 rows · primary key (invoice_id)Invoices issued for paid subscription rows: monthly plans are invoiced every month, annual plans once a year for 12 × mrr. Trials are never invoiced.
| Column | Type | Null? | Key | Description |
|---|---|---|---|---|
| invoice_id | integer | no | PK | Unique invoice number. |
| subscription_id | integer | no | subscriptions.subscription_id | The subscription row being billed. |
| issued_on | date | no | Date the invoice was issued. | |
| due_on | date | no | Payment due date (issued_on + 14 days). | |
| period_start | date | no | First day of the service period billed. | |
| period_end | date | no | Last day of the service period billed (inclusive). | |
| amount | numeric(12,2) | no | Invoice total in SAR (excluding VAT). | |
| status | text | no | paid, open (awaiting payment), void (cancelled and usually re-issued) or uncollectible (written off). | |
| paid_on | date | yes | Date payment was received. NULL unless status = 'paid'. |
events
58,595 rows · primary key (event_id)Product analytics events, one row per tracked action. Contains a small number of exact duplicates caused by client retries.
| Column | Type | Null? | Key | Description |
|---|---|---|---|---|
| event_id | bigint | no | PK | Unique event number (ascending with time). |
| user_id | integer | no | users.user_id | Who performed the action. |
| account_id | integer | no | accounts.account_id | The user's account (denormalised for convenience). |
| event_name | text | no | signup (user activated), login, create_report, share_report, invite_user, export_data or integration_connected. | |
| occurred_at | timestamp | no | When it happened (Riyadh local time). |
support_tickets
1,205 rows · primary key (ticket_id)Customer support tickets.
| Column | Type | Null? | Key | Description |
|---|---|---|---|---|
| ticket_id | integer | no | PK | Unique ticket number. |
| account_id | integer | no | accounts.account_id | The customer account. |
| opened_by_user_id | integer | yes | users.user_id | User who opened the ticket. NULL when it came from an unknown email address. |
| opened_at | timestamp | no | When the ticket was opened. | |
| first_response_at | timestamp | yes | First reply from support. NULL = not answered yet. | |
| closed_at | timestamp | yes | When the ticket was closed. NULL = still open on 2025-12-31. | |
| priority | text | no | low, normal, high or urgent. | |
| category | text | no | how_to, bug, billing, integration, account_access or feature_request. | |
| satisfaction_score | smallint | yes | Customer rating 1–5 after closing. NULL = no survey answer. |