0
← Exercises/
Fundamentals•8 of 12
FundamentalsBeginnerPRO

Dormant SaaS Tenants with Missing Payment Methods

Scenario

CloudScale's billing service fails when organizations upgrade beyond the free trial but have no saved payment method. The finance team needs an urgent audit list of all paying tenants whose `stripe_customer_id` is NULL.

Task
Find all records in the `organizations` table where: - `billing_tier` is one of `'Starter'`, `'Professional'`, or `'Enterprise'` - `stripe_customer_id` is `NULL` Return: 1. `org_id` 2. `org_name` 3. `billing_tier` 4. `created_at` Order the results by `created_at` ascending, then by `org_id` ascending.
Expected Output Format

Paid tier accounts missing payment provider credentials, sorted by creation date.

Input Tables & Sample Data0 tables
Loading database schema...
Need a hint?
query.sql|Local Sandbox
Loading SQL editor...
Click "Run" or press ⌘ + Enter to execute your query

About the “Dormant SaaS Tenants with Missing Payment Methods” SQL Problem

Business Scenario

CloudScale's billing service fails when organizations upgrade beyond the free trial but have no saved payment method. The finance team needs an urgent audit list of all paying tenants whose `stripe_customer_id` is NULL.

Expected Output & Criteria

Paid tier accounts missing payment provider credentials, sorted by creation date.

Database Table Schema (PostgreSQL DDL)

PostgreSQL 16 WASM

This challenge executes directly against the following relational schema in your browser:

CREATE TABLE organizations (
        org_id INT PRIMARY KEY,
        org_name VARCHAR(100) NOT NULL,
        billing_tier VARCHAR(30) NOT NULL,
        stripe_customer_id VARCHAR(50),
        created_at DATE NOT NULL
      );

Target SQL Clauses & Operators

WHEREIS NULLORDER BY

Want more Fundamentals practice?

Explore the full syllabus of 12 exercises, syntax guides, and interview pitfalls.

View Fundamentals Track→