{
  "format": "dataset-manifest/1",
  "slug": "subscription-billing",
  "version": 2,
  "seed": "subscription-billing:1",
  "spec": {
    "format": "dataset/1",
    "slug": "subscription-billing",
    "name": "Subscription Billing",
    "tagline": "Manage and analyze SaaS subscription billing seamlessly.",
    "description": "SaaS companies rely on effective subscription billing systems to manage their customer subscriptions, billing cycles, and payments. This dataset models the entire subscription billing lifecycle, including customers, subscription plans, active subscriptions, invoices, and payment histories. Each table is designed to capture specific aspects of the billing process, allowing users to explore relationships between customers, their chosen plans, and the payment processes involved. The dataset is synthetic, making it suitable for various applications such as SQL practice, API mocking, or analytics demos. By examining this data, developers can answer practical questions related to customer behavior, revenue forecasting, and payment success rates. The tables are interconnected, enabling users to perform insightful analyses on subscription trends and payment performance.",
    "domain": "saas",
    "shape": "transactional",
    "useCases": [
      "sql-practice",
      "api-mocking"
    ],
    "keywords": [
      "subscription",
      "billing",
      "saas",
      "invoices",
      "payments",
      "customers",
      "plans",
      "cancellations"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "customers": {
        "description": "This table holds customer information, linking each customer to their subscriptions and payment history.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each customer."
          },
          "full_name": {
            "kind": "fullName",
            "description": "Full name of the customer."
          },
          "email": {
            "kind": "email",
            "from": "full_name",
            "description": "Email address of the customer."
          },
          "signup_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date the customer signed up.",
            "trend": "growing"
          },
          "status": {
            "kind": "enum",
            "values": [
              "active",
              "inactive",
              "cancelled"
            ],
            "description": "Current status of the customer.",
            "weights": [
              8,
              2,
              1
            ]
          }
        }
      },
      "plans": {
        "description": "This table lists the different subscription plans available to customers, detailing pricing and features.",
        "rows": 10,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each subscription plan."
          },
          "plan_name": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Name of the subscription plan.",
            "pool": [
              "basic",
              "premium",
              "enterprise",
              "starter",
              "pro",
              "business",
              "gold",
              "silver",
              "platinum",
              "family",
              "individual",
              "annual",
              "monthly",
              "team",
              "ultimate",
              "student",
              "professional",
              "custom",
              "flexible",
              "standard",
              "advanced",
              "lite",
              "plus",
              "essentials",
              "growth",
              "value",
              "special",
              "exclusive",
              "limited",
              "trial",
              "seasonal",
              "legacy",
              "dynamic",
              "enhanced",
              "dedicated",
              "collaborative",
              "onboarding",
              "support",
              "full",
              "complete",
              "integrated",
              "comprehensive",
              "tailored",
              "basic+",
              "premium+",
              "enterprise+",
              "all-access",
              "unlimited",
              "add-on",
              "feature-rich",
              "enhanced+",
              "flex",
              "choice",
              "select"
            ]
          },
          "monthly_price": {
            "kind": "decimal",
            "min": 5,
            "max": 100,
            "scale": 2,
            "description": "Monthly cost of the subscription plan.",
            "distribution": "high"
          },
          "features": {
            "kind": "sentence",
            "description": "Features included in the subscription plan."
          }
        }
      },
      "subscriptions": {
        "description": "This table tracks the subscriptions each customer has, including any upgrades or cancellations.",
        "rows": 300,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each subscription."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.id",
            "description": "Foreign key linking to the customer."
          },
          "plan_id": {
            "kind": "fk",
            "ref": "plans.id",
            "description": "Foreign key linking to the subscription plan."
          },
          "start_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Start date of the subscription.",
            "trend": "growing"
          },
          "status": {
            "kind": "enum",
            "values": [
              "active",
              "cancelled",
              "paused"
            ],
            "description": "Current status of the subscription.",
            "weights": [
              7,
              2,
              1
            ]
          }
        }
      },
      "invoices": {
        "description": "This table contains invoices generated for each subscription period, including amounts and statuses.",
        "rows": 400,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each invoice."
          },
          "subscription_id": {
            "kind": "fk",
            "ref": "subscriptions.id",
            "description": "Foreign key linking to the subscription."
          },
          "amount": {
            "kind": "decimal",
            "min": 5,
            "max": 100,
            "scale": 2,
            "description": "Total amount of the invoice.",
            "distribution": "long-tail"
          },
          "issue_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date the invoice was issued.",
            "trend": "seasonal"
          },
          "status": {
            "kind": "enum",
            "values": [
              "paid",
              "pending",
              "failed"
            ],
            "description": "Current status of the invoice.",
            "weights": [
              6,
              3,
              1
            ]
          }
        }
      },
      "payments": {
        "description": "This table records payment attempts for each invoice, capturing successes and failures.",
        "rows": 500,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each payment record."
          },
          "invoice_id": {
            "kind": "fk",
            "ref": "invoices.id",
            "description": "Foreign key linking to the invoice."
          },
          "payment_date": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date and time when the payment was attempted.",
            "dayProfile": "business"
          },
          "amount": {
            "kind": "decimal",
            "min": 5,
            "max": 100,
            "scale": 2,
            "description": "Amount paid in the transaction.",
            "distribution": "long-tail"
          },
          "status": {
            "kind": "enum",
            "values": [
              "successful",
              "failed",
              "retry"
            ],
            "description": "Status of the payment attempt.",
            "weights": [
              9,
              2,
              1
            ]
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "categorical",
      "timestamped",
      "monetary",
      "nullable"
    ],
    "analysisQuestions": [
      "What is the average payment success rate for customers?",
      "Which subscription plans generate the most revenue?",
      "How many customers have upgraded their subscription plans?",
      "What percentage of invoices are paid on time?",
      "Which customer segments are most likely to cancel their subscriptions?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Customers and Subscriptions",
        "sql": "SELECT c.full_name, s.start_date, s.status FROM customers c JOIN subscriptions s ON c.id = s.customer_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count Active Subscriptions by Plan",
        "sql": "SELECT p.plan_name, COUNT(s.id) FROM plans p JOIN subscriptions s ON p.id = s.plan_id WHERE s.status = 'active' GROUP BY p.plan_name;",
        "dialect": "postgres"
      },
      {
        "title": "Invoice Status Summary",
        "sql": "SELECT status, COUNT(*) FROM invoices GROUP BY status;",
        "dialect": "postgres"
      },
      {
        "title": "Payments Overview with Status",
        "sql": "SELECT p.payment_date, p.amount, p.status FROM payments p JOIN invoices i ON p.invoice_id = i.id WHERE i.status = 'paid';",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Financial Analytics",
        "body": "Finance analysts can use this dataset to track revenue streams, analyze subscription trends, and project future earnings. By running queries on invoices and payments, they can identify patterns in customer payment behaviors and adjust forecasts accordingly."
      },
      {
        "title": "Customer Retention Strategies",
        "body": "Marketing teams can leverage the data to understand customer churn. By analyzing the cancellation rates and reasons, they can develop targeted strategies to improve customer retention, such as offering discounts or additional features."
      },
      {
        "title": "API Development and Testing",
        "body": "Developers can use this dataset to mock API responses for subscription management systems. By simulating various customer scenarios, they can ensure that their applications handle different states of subscriptions, invoices, and payment statuses effectively."
      }
    ]
  },
  "counts": {
    "customers": 200,
    "plans": 10,
    "subscriptions": 300,
    "invoices": 400,
    "payments": 500
  },
  "stats": {
    "customers": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "full_name": {
          "nulls": 0,
          "distinct": 198,
          "min": "Alice Castro",
          "max": "Zoe Vargas"
        },
        "email": {
          "nulls": 0,
          "distinct": 200
        },
        "signup_date": {
          "nulls": 0,
          "distinct": 188,
          "min": "2020-01-12",
          "max": "2023-12-24"
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "active",
          "max": "inactive"
        }
      }
    },
    "plans": {
      "rows": 10,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "plan_name": {
          "nulls": 0,
          "distinct": 10
        },
        "monthly_price": {
          "nulls": 0,
          "distinct": 10,
          "min": 8.84,
          "max": 99.19
        },
        "features": {
          "nulls": 0,
          "distinct": 10
        }
      }
    },
    "subscriptions": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 160,
          "min": 1,
          "max": 200
        },
        "plan_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "start_date": {
          "nulls": 0,
          "distinct": 271,
          "min": "2020-01-05",
          "max": "2023-12-26"
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "active",
          "max": "paused"
        }
      }
    },
    "invoices": {
      "rows": 400,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 400,
          "min": 1,
          "max": 400
        },
        "subscription_id": {
          "nulls": 0,
          "distinct": 221,
          "min": 1,
          "max": 300
        },
        "amount": {
          "nulls": 0,
          "distinct": 387,
          "min": 5,
          "max": 99.31
        },
        "issue_date": {
          "nulls": 0,
          "distinct": 348,
          "min": "2020-01-10",
          "max": "2023-12-31"
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "failed",
          "max": "pending"
        }
      }
    },
    "payments": {
      "rows": 500,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 500,
          "min": 1,
          "max": 500
        },
        "invoice_id": {
          "nulls": 0,
          "distinct": 277,
          "min": 1,
          "max": 399
        },
        "payment_date": {
          "nulls": 0,
          "distinct": 500,
          "min": "2020-01-09 09:05:04",
          "max": "2023-12-31 18:50:14"
        },
        "amount": {
          "nulls": 0,
          "distinct": 469,
          "min": 5,
          "max": 99.59
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "failed",
          "max": "successful"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/customers.csv",
      "format": "csv",
      "table": "customers",
      "key": "datasets/subscription-billing/v2/csv/customers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/csv/customers.csv",
      "bytes": 11954,
      "sha256": "cf4f65611763fee7ed70b64f5be0d65744789ccdf335959d2ae9319d5dfb839f",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/plans.csv",
      "format": "csv",
      "table": "plans",
      "key": "datasets/subscription-billing/v2/csv/plans.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/csv/plans.csv",
      "bytes": 831,
      "sha256": "a66e5e2dd78553b612b4158c54b3ee1b09f1f2a46b62842ab81258e068ec4e15",
      "rows": 10,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/subscriptions.csv",
      "format": "csv",
      "table": "subscriptions",
      "key": "datasets/subscription-billing/v2/csv/subscriptions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/csv/subscriptions.csv",
      "bytes": 8736,
      "sha256": "9a8b6a416014ccea190a647dc8fdbefa34c7b7dd5e44d745f24ce58c6523d0be",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/invoices.csv",
      "format": "csv",
      "table": "invoices",
      "key": "datasets/subscription-billing/v2/csv/invoices.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/csv/invoices.csv",
      "bytes": 12565,
      "sha256": "9e8acd48c3f187d66c3af14533d8b5a1a6f06a010daf0a6f4152a57b117a31dc",
      "rows": 400,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/payments.csv",
      "format": "csv",
      "table": "payments",
      "key": "datasets/subscription-billing/v2/csv/payments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/csv/payments.csv",
      "bytes": 22110,
      "sha256": "8cfb127ae808bd798e0b917c3b985c0eed6374f072ec327de4ba8e281de1af0a",
      "rows": 500,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "subscription-billing.json",
      "format": "json",
      "table": null,
      "key": "datasets/subscription-billing/v2/subscription-billing.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/subscription-billing.json",
      "bytes": 206693,
      "sha256": "dd43bdd9d60281ba4c0b5f83d0f68fdd143d70c442587313e54587f213229efd",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/subscription-billing/v2/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/sql/postgres.sql",
      "bytes": 79725,
      "sha256": "c167dc6ed2c8a49edb75f49f20a7cc1f4910c872cd9ba0bd36051f97cb128c27",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/subscription-billing/v2/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/sql/mysql.sql",
      "bytes": 79171,
      "sha256": "5f738a2d10aaab400526dff7c9369c6e10d89e765f6af3be30b746864e0f4d51",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/subscription-billing/v2/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/sql/mssql.sql",
      "bytes": 82719,
      "sha256": "bb488751f3b7c852b4eb2e1c19da6b34834e9659967fa6f3293e7d19fa8749c2",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/subscription-billing/v2/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/sql/sqlite.sql",
      "bytes": 78954,
      "sha256": "32c68f9abb82bafe31d15fb750d9e0d5c069a1a7cae6f209746384452e24cb46",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/subscription-billing/v2/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/prisma/seed.ts",
      "bytes": 164373,
      "sha256": "151d9250c2df3d4f7e47f2072e8778f868dbce4f66b29a87af86b50f0977d2ab",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/subscription-billing/v2/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/subscription-billing/v2/django/fixtures.json",
      "bytes": 268234,
      "sha256": "b3028a882658f31c7cb63114d784176fb3fea1ccc90070cdf0c6f43a0f4ab963",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788734239858,
  "updatedAt": 1788786287451
}
