{
  "format": "dataset-manifest/1",
  "slug": "plan-history",
  "version": 1,
  "seed": "plan-history:1",
  "spec": {
    "format": "dataset/1",
    "slug": "plan-history",
    "name": "Plan History",
    "tagline": "Track customer plan changes over time with versioned records.",
    "description": "SaaS companies frequently update their customer plans, leading to various changes in features, pricing, and subscription models. The Plan History dataset captures this evolution by modeling customer accounts and their associated plan changes over time. This dataset allows users to analyze how customer plans have shifted, providing insights into customer retention, upselling opportunities, and the impact of plan changes on customer behavior. By linking customer accounts with their respective plan versions, it answers key questions such as which plan a customer was on during a specific timeframe and how often customers switch between plans. The tables are synthetic, designed for practice in SQL and teaching data manipulation, enabling users to work through real-world scenarios without the complexities of production data.",
    "domain": "saas",
    "shape": "slowly-changing",
    "useCases": [
      "sql-practice",
      "teaching"
    ],
    "keywords": [
      "customer plans",
      "subscription changes",
      "version control",
      "SaaS analytics",
      "data modeling"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "customers": {
        "description": "Each row represents a unique customer account. It links to their plan history through customer_id.",
        "rows": 200,
        "columns": {
          "customer_id": {
            "kind": "pk",
            "description": "Unique identifier for each customer account."
          },
          "full_name": {
            "kind": "fullName",
            "description": "The full name of the customer."
          },
          "email": {
            "kind": "email",
            "from": "full_name",
            "description": "Contact email for the customer."
          },
          "created_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "Date when the customer account was created.",
            "dayProfile": "business"
          }
        }
      },
      "plans": {
        "description": "This table holds available plans that customers can subscribe to. Each plan has a unique identifier and associated features.",
        "rows": 10,
        "columns": {
          "plan_id": {
            "kind": "pk",
            "description": "Unique identifier for each plan."
          },
          "plan_name": {
            "kind": "words",
            "min": 2,
            "max": 5,
            "description": "Name of the subscription plan."
          },
          "price": {
            "kind": "decimal",
            "min": 10,
            "max": 1000,
            "scale": 2,
            "description": "Monthly price of the subscription plan."
          },
          "features": {
            "kind": "sentence",
            "description": "A brief description of the key features included in the plan."
          }
        }
      },
      "plan_changes": {
        "description": "Records changes to customer plans over time, linking each change to a specific customer and plan.",
        "rows": 800,
        "columns": {
          "change_id": {
            "kind": "pk",
            "description": "Unique identifier for each plan change record."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.customer_id",
            "description": "Identifier for the customer whose plan is being changed."
          },
          "plan_id": {
            "kind": "fk",
            "ref": "plans.plan_id",
            "description": "Identifier for the new plan the customer is switching to."
          },
          "valid_from": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "Date when the plan change becomes effective.",
            "trend": "growing"
          },
          "valid_to": {
            "kind": "date",
            "after": "valid_from",
            "withinDays": 365,
            "description": "Date when the plan change is no longer valid."
          }
        }
      },
      "plan_features": {
        "description": "This table details specific features associated with each plan, allowing for deeper analysis of what features are linked to customer satisfaction and retention.",
        "rows": 40,
        "columns": {
          "feature_id": {
            "kind": "pk",
            "description": "Unique identifier for each feature."
          },
          "plan_id": {
            "kind": "fk",
            "ref": "plans.plan_id",
            "description": "Identifier for the plan that includes this feature."
          },
          "feature_description": {
            "kind": "sentence",
            "description": "Description of the feature offered by the plan."
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "timestamped",
      "high-cardinality",
      "nullable"
    ],
    "analysisQuestions": [
      "What percentage of customers change their plan each year?",
      "Which plans are the most frequently upgraded or downgraded?",
      "How do plan changes affect customer retention rates over time?",
      "What features are most commonly associated with customer churn?",
      "Is there a seasonal pattern in plan changes?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Customers with Their Plan Changes",
        "sql": "SELECT c.full_name, pc.valid_from, p.plan_name FROM customers c JOIN plan_changes pc ON c.customer_id = pc.customer_id JOIN plans p ON pc.plan_id = p.plan_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count Plan Changes Over Time",
        "sql": "SELECT DATE_TRUNC('month', pc.valid_from) AS month, COUNT(*) AS changes FROM plan_changes pc GROUP BY month ORDER BY month;",
        "dialect": "postgres"
      },
      {
        "title": "Find Customers with Multiple Plan Changes",
        "sql": "SELECT c.full_name, COUNT(pc.change_id) AS change_count FROM customers c JOIN plan_changes pc ON c.customer_id = pc.customer_id GROUP BY c.full_name HAVING COUNT(pc.change_id) > 1;",
        "dialect": "postgres"
      },
      {
        "title": "Analyze Features by Plan",
        "sql": "SELECT p.plan_name, COUNT(pf.feature_id) AS feature_count FROM plans p JOIN plan_features pf ON p.plan_id = pf.plan_id GROUP BY p.plan_name;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "SaaS Product Analysts",
        "body": "SaaS product analysts can leverage the Plan History dataset to identify trends in customer subscription behavior. By analyzing plan changes over time, they can assess which features are driving upgrades or downgrades, allowing them to refine their product offerings and marketing strategies."
      },
      {
        "title": "Data Science Students",
        "body": "Data science students can use this dataset as a practical exercise in SQL querying and data manipulation. By engaging with the various relationships between customers, plans, and changes, they can practice constructing complex queries and gain a deeper understanding of slowly-changing dimensions in data modeling."
      },
      {
        "title": "Customer Success Managers",
        "body": "Customer success managers can utilize the Plan History dataset to track customer engagement and satisfaction. By examining the plan changes and their timings, they can proactively reach out to customers who may be at risk of downgrading their subscriptions, ensuring better retention and satisfaction."
      },
      {
        "title": "Business Intelligence Developers",
        "body": "Business intelligence developers can integrate this data into dashboards to visualize customer plan trends over time. By creating reports that highlight plan changes, they can provide insights to leadership for strategic decision-making regarding pricing, features, and customer acquisition efforts."
      }
    ]
  },
  "counts": {
    "customers": 200,
    "plans": 10,
    "plan_changes": 800,
    "plan_features": 40
  },
  "stats": {
    "customers": {
      "rows": 200,
      "columns": {
        "customer_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "full_name": {
          "nulls": 0,
          "distinct": 199,
          "min": "Alice Hoffmann",
          "max": "Zoe Oliveira"
        },
        "email": {
          "nulls": 0,
          "distinct": 200
        },
        "created_at": {
          "nulls": 0,
          "distinct": 200,
          "min": "2020-01-02 12:29:11",
          "max": "2022-12-27 13:57:59"
        }
      }
    },
    "plans": {
      "rows": 10,
      "columns": {
        "plan_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "plan_name": {
          "nulls": 0,
          "distinct": 10
        },
        "price": {
          "nulls": 0,
          "distinct": 10,
          "min": 183.54,
          "max": 948.08
        },
        "features": {
          "nulls": 0,
          "distinct": 10
        }
      }
    },
    "plan_changes": {
      "rows": 800,
      "columns": {
        "change_id": {
          "nulls": 0,
          "distinct": 800,
          "min": 1,
          "max": 800
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 198,
          "min": 2,
          "max": 200
        },
        "plan_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "valid_from": {
          "nulls": 0,
          "distinct": 568,
          "min": "2020-01-01",
          "max": "2023-01-01"
        },
        "valid_to": {
          "nulls": 0,
          "distinct": 601,
          "min": "2020-01-14",
          "max": "2023-11-30"
        }
      }
    },
    "plan_features": {
      "rows": 40,
      "columns": {
        "feature_id": {
          "nulls": 0,
          "distinct": 40,
          "min": 1,
          "max": 40
        },
        "plan_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "feature_description": {
          "nulls": 0,
          "distinct": 40
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/customers.csv",
      "format": "csv",
      "table": "customers",
      "key": "datasets/plan-history/v1/csv/customers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/csv/customers.csv",
      "bytes": 12156,
      "sha256": "44396085bab124cbd769bc89c61604da0c8555e45378e16751bf5fe599b0caaa",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/plans.csv",
      "format": "csv",
      "table": "plans",
      "key": "datasets/plan-history/v1/csv/plans.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/csv/plans.csv",
      "bytes": 884,
      "sha256": "b69b4ac99004ddd01a08cbfb9b61d64f564a0498eab1cd20d163f3ee80b4d268",
      "rows": 10,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/plan_changes.csv",
      "format": "csv",
      "table": "plan_changes",
      "key": "datasets/plan-history/v1/csv/plan_changes.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/csv/plan_changes.csv",
      "bytes": 26014,
      "sha256": "bac543288871a59a3eaaaff783727452896a7d8c491d969a008f340d6269da45",
      "rows": 800,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/plan_features.csv",
      "format": "csv",
      "table": "plan_features",
      "key": "datasets/plan-history/v1/csv/plan_features.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/csv/plan_features.csv",
      "bytes": 2480,
      "sha256": "718f840a5fabdf9710ef55aaaa8598522be85b2a3bcc3a54da2f9d3f4e9d3e34",
      "rows": 40,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "plan-history.json",
      "format": "json",
      "table": null,
      "key": "datasets/plan-history/v1/plan-history.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/plan-history.json",
      "bytes": 156807,
      "sha256": "a37f2fb5dc242a137635290f2b04e3b565fdad2498c43f0588f17cc0a8b71979",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/plan-history/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/sql/postgres.sql",
      "bytes": 58655,
      "sha256": "fb1952505be95f281991daeedc230eaecffda0b4253ae665b44edcdc8a8747ae",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/plan-history/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/sql/mysql.sql",
      "bytes": 58147,
      "sha256": "d5b105654b4a28a829130e015675592d7a311f5be4b5c274df1e05b1817ddb7a",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/plan-history/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/sql/mssql.sql",
      "bytes": 60687,
      "sha256": "d094932884bfa968bdae042b085d22f2439282af0dc93d79bf4ba0f8e0113d94",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/plan-history/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/sql/sqlite.sql",
      "bytes": 57988,
      "sha256": "ce7e5f53e666bdef69ac63e79e870dc83cb3c1e8e907fa4ef1232be321772bf6",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/plan-history/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/prisma/seed.ts",
      "bytes": 124481,
      "sha256": "32cb767870f08738b3de2fcc12fd2768dbca3fbbdcfe2855e0dcf00489aedb17",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/plan-history/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/plan-history/v1/django/fixtures.json",
      "bytes": 193180,
      "sha256": "e608a4b8cb9a23210b6b47e869917779d5f3836c6a534638e0e466988ad0bb47",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788766943516,
  "updatedAt": 1788766943516
}
