{
  "format": "dataset-manifest/1",
  "slug": "customer-loyalty-program-platform",
  "version": 1,
  "seed": "customer-loyalty-program-platform:1",
  "spec": {
    "format": "dataset/1",
    "slug": "customer-loyalty-program-platform",
    "name": "Loyalty Program Insights",
    "tagline": "Customer transactions, reward tiers, promotions, and coupon usage from a loyalty program.",
    "description": "Customers interact with a loyalty program that aims to reward their repeat business and cultivate stronger relationships. Through this program, individuals earn rewards based on their transactions, which vary in frequency and value. Some customers make regular purchases, while others might engage during specific promotional events, leading to noticeable spikes in transaction volumes. This dynamic creates an engaging environment where customers can explore various reward tiers, each offering unique incentives for continued loyalty.\n\nThe dataset consists of multiple tables that interconnect to paint a comprehensive picture of customer interactions and program effectiveness. The 'customers' table holds information about individuals enrolled in the loyalty program, detailing their demographics and engagement levels. The 'transactions' table records each customer's purchases, including the dates and amounts, allowing for the analysis of spending behaviors over time. Joining these two tables via customer IDs reveals insights into how specific demographics engage with the program.\n\nThe 'reward_tiers' table outlines the different levels within the loyalty program, defining criteria for customers to advance based on their spending. This connects to 'transactions', enabling a deeper analysis of how tier levels impact customer loyalty and spending patterns. The 'promotions' table describes various marketing activities aimed at incentivizing customer purchases, while the 'coupons' table provides information on discount codes and their redemption rates. By linking these tables, developers can explore how promotions and coupons influence transaction spikes and customer engagement.\n\nPracticing with this synthetic dataset allows users to answer questions such as: Which customer segments are most responsive to promotions? How do reward tiers impact overall spending? What patterns emerge from coupon usage during high-traffic sales events? This dataset serves as a valuable resource for those looking to refine their skills in data analysis, enabling them to extract actionable insights from marketing and customer behavior data.",
    "domain": "marketing",
    "shape": "ledger",
    "useCases": [
      "sql-practice",
      "teaching"
    ],
    "keywords": [
      "loyalty program",
      "customer engagement",
      "reward tiers",
      "promotions",
      "transactions",
      "coupons",
      "marketing data"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "customers": {
        "description": "This table contains customer details, linking them to their loyalty program participation. Each customer has a unique ID and can be associated with multiple transactions.",
        "rows": 200,
        "columns": {
          "customer_id": {
            "kind": "pk",
            "description": "Unique identifier for each customer."
          },
          "first_name": {
            "kind": "firstName",
            "description": "Customer's first name."
          },
          "last_name": {
            "kind": "lastName",
            "description": "Customer's last name."
          },
          "email": {
            "kind": "email",
            "from": [
              "first_name",
              "last_name"
            ],
            "description": "Customer's email address."
          },
          "join_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the customer joined the loyalty program."
          },
          "tier": {
            "kind": "enum",
            "values": [
              "bronze",
              "silver",
              "gold",
              "platinum"
            ],
            "description": "Current loyalty tier of the customer."
          }
        }
      },
      "transactions": {
        "description": "This table records each transaction made by customers, linking back to the customers table. Transaction rows capture the details of amounts spent and reward points earned.",
        "rows": 600,
        "columns": {
          "transaction_id": {
            "kind": "pk",
            "description": "Unique identifier for each transaction."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.customer_id",
            "description": "Reference to the customer making the transaction."
          },
          "transaction_date": {
            "kind": "datetime",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "dayProfile": "business",
            "description": "Date and time of the transaction."
          },
          "amount_spent": {
            "kind": "decimal",
            "min": 5,
            "max": 500,
            "scale": 2,
            "distribution": "long-tail",
            "description": "Total amount spent in the transaction."
          },
          "points_earned": {
            "kind": "int",
            "min": 5,
            "max": 50,
            "description": "Points earned from the transaction based on the amount spent."
          }
        }
      },
      "reward_tiers": {
        "description": "This table outlines the different reward tiers available in the loyalty program, detailing the benefits associated with each level.",
        "rows": 4,
        "columns": {
          "tier": {
            "kind": "pk",
            "description": "Name of the reward tier."
          },
          "min_points": {
            "kind": "int",
            "min": 0,
            "max": 200,
            "description": "Minimum points required to attain this tier."
          },
          "benefits": {
            "kind": "words",
            "min": 10,
            "max": 100,
            "description": "Description of benefits associated with this reward tier."
          }
        }
      },
      "promotions": {
        "description": "This table lists promotional events linked to customer engagement, capturing how these promotions influence transaction behavior.",
        "rows": 100,
        "columns": {
          "promotion_id": {
            "kind": "pk",
            "description": "Unique identifier for each promotion."
          },
          "promotion_name": {
            "kind": "words",
            "min": 5,
            "max": 50,
            "description": "Name of the promotional event."
          },
          "start_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "Start date of the promotion."
          },
          "end_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "End date of the promotion."
          },
          "discount_percentage": {
            "kind": "decimal",
            "min": 5,
            "max": 50,
            "scale": 0,
            "description": "Percentage discount offered during the promotion."
          }
        }
      },
      "coupons": {
        "description": "This table captures information about issued coupons that customers can use. Each coupon can be linked to specific transactions.",
        "rows": 300,
        "columns": {
          "coupon_id": {
            "kind": "pk",
            "description": "Unique identifier for each coupon."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.customer_id",
            "description": "Reference to the customer who received the coupon."
          },
          "promotion_id": {
            "kind": "fk",
            "ref": "promotions.promotion_id",
            "nullable": true,
            "description": "Reference to the promotion associated with the coupon."
          },
          "issue_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "Date when the coupon was issued."
          },
          "expiration_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "Expiration date of the coupon."
          },
          "discount_value": {
            "kind": "decimal",
            "min": 1,
            "max": 100,
            "scale": 2,
            "description": "Monetary value of the discount offered by the coupon."
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "monetary",
      "timestamped",
      "categorical"
    ],
    "analysisQuestions": [
      "How does customer spending vary between different reward tiers?",
      "What promotional activities lead to the highest engagement rates?",
      "Which coupons are most frequently redeemed by customers?",
      "What is the average transaction amount over the year?",
      "How does the timing of promotions affect customer transactions?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Customers and Transactions",
        "sql": "SELECT c.first_name, c.last_name, t.amount_spent FROM customers c JOIN transactions t ON c.customer_id = t.customer_id;",
        "dialect": "postgres"
      },
      {
        "title": "Aggregate Spending by Tier",
        "sql": "SELECT tier, SUM(amount_spent) AS total_spent FROM customers c JOIN transactions t ON c.customer_id = t.customer_id GROUP BY tier;",
        "dialect": "postgres"
      },
      {
        "title": "Promotions Impact on Transactions",
        "sql": "SELECT p.promotion_name, COUNT(t.transaction_id) AS transaction_count FROM promotions p LEFT JOIN transactions t ON t.transaction_date BETWEEN p.start_date AND p.end_date GROUP BY p.promotion_name;",
        "dialect": "postgres"
      },
      {
        "title": "Average Points Earned per Transaction",
        "sql": "SELECT AVG(points_earned) AS avg_points FROM transactions;",
        "dialect": "postgres"
      },
      {
        "title": "Coupons Redeemed by Customers",
        "sql": "SELECT c.first_name, c.last_name, COUNT(co.coupon_id) AS coupons_redeemed FROM customers c JOIN coupons co ON c.customer_id = co.customer_id GROUP BY c.customer_id;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Marketing Analyst",
        "body": "A marketing analyst can use this dataset to evaluate the effectiveness of various promotional strategies by analyzing customer spending patterns and engagement metrics. By examining the relationship between promotions and transactions, the analyst can identify which campaigns are driving the most value for the business."
      },
      {
        "title": "Business Educator",
        "body": "An educator teaching marketing principles can leverage this dataset to demonstrate how loyalty programs work in practice. Students can analyze real-world scenarios of customer behavior, drawing insights from transaction data to understand consumer psychology and marketing effectiveness."
      },
      {
        "title": "Data Scientist",
        "body": "A data scientist can apply machine learning techniques to this dataset to predict customer behavior based on past transactions and coupon usage. By building models that analyze engagement and spending, they can help businesses tailor their loyalty programs to maximize customer satisfaction and retention."
      },
      {
        "title": "SQL Learner",
        "body": "Individuals learning SQL can use this dataset to practice writing queries across multiple tables. They can explore relationships between customers, transactions, and promotions, gaining hands-on experience with complex joins and aggregate functions while honing their data analysis skills."
      }
    ]
  },
  "counts": {
    "customers": 200,
    "promotions": 100,
    "coupons": 300,
    "reward_tiers": 4,
    "transactions": 600
  },
  "stats": {
    "customers": {
      "rows": 200,
      "columns": {
        "customer_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "first_name": {
          "nulls": 0,
          "distinct": 76,
          "min": "Alice",
          "max": "Zoe"
        },
        "last_name": {
          "nulls": 0,
          "distinct": 74,
          "min": "Adams",
          "max": "Zhang"
        },
        "email": {
          "nulls": 0,
          "distinct": 200
        },
        "join_date": {
          "nulls": 0,
          "distinct": 189,
          "min": "2020-01-03",
          "max": "2023-12-25"
        },
        "tier": {
          "nulls": 0,
          "distinct": 4,
          "min": "bronze",
          "max": "silver"
        }
      }
    },
    "transactions": {
      "rows": 600,
      "columns": {
        "transaction_id": {
          "nulls": 0,
          "distinct": 600,
          "min": 1,
          "max": 600
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 192,
          "min": 1,
          "max": 200
        },
        "transaction_date": {
          "nulls": 0,
          "distinct": 600,
          "min": "2023-01-02 09:41:25",
          "max": "2023-12-30 20:34:05"
        },
        "amount_spent": {
          "nulls": 0,
          "distinct": 591,
          "min": 5,
          "max": 497.42
        },
        "points_earned": {
          "nulls": 0,
          "distinct": 46,
          "min": 5,
          "max": 50
        }
      }
    },
    "reward_tiers": {
      "rows": 4,
      "columns": {
        "tier": {
          "nulls": 0,
          "distinct": 4,
          "min": 1,
          "max": 4
        },
        "min_points": {
          "nulls": 0,
          "distinct": 4,
          "min": 35,
          "max": 141
        },
        "benefits": {
          "nulls": 0,
          "distinct": 4
        }
      }
    },
    "promotions": {
      "rows": 100,
      "columns": {
        "promotion_id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "promotion_name": {
          "nulls": 0,
          "distinct": 100
        },
        "start_date": {
          "nulls": 0,
          "distinct": 89,
          "min": "2023-01-05",
          "max": "2023-12-27"
        },
        "end_date": {
          "nulls": 0,
          "distinct": 83,
          "min": "2023-01-01",
          "max": "2023-12-30"
        },
        "discount_percentage": {
          "nulls": 0,
          "distinct": 40,
          "min": 6,
          "max": 50
        }
      }
    },
    "coupons": {
      "rows": 300,
      "columns": {
        "coupon_id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 156,
          "min": 1,
          "max": 200
        },
        "promotion_id": {
          "nulls": 25,
          "distinct": 92,
          "min": 1,
          "max": 100
        },
        "issue_date": {
          "nulls": 0,
          "distinct": 202,
          "min": "2023-01-02",
          "max": "2023-12-31"
        },
        "expiration_date": {
          "nulls": 0,
          "distinct": 216,
          "min": "2023-01-01",
          "max": "2023-12-30"
        },
        "discount_value": {
          "nulls": 0,
          "distinct": 296,
          "min": 2.05,
          "max": 99.53
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/customers.csv",
      "format": "csv",
      "table": "customers",
      "key": "datasets/customer-loyalty-program-platform/v1/csv/customers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/csv/customers.csv",
      "bytes": 11751,
      "sha256": "151171c3ac5b0ec60ba3305483706f0b2cf2b4798541418d9d71cb41c36d4d85",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/promotions.csv",
      "format": "csv",
      "table": "promotions",
      "key": "datasets/customer-loyalty-program-platform/v1/csv/promotions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/csv/promotions.csv",
      "bytes": 21946,
      "sha256": "c450b45752fb80595c21eac82f24ad9d8aff7946090036eae6e94a72583f2e3c",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/coupons.csv",
      "format": "csv",
      "table": "coupons",
      "key": "datasets/customer-loyalty-program-platform/v1/csv/coupons.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/csv/coupons.csv",
      "bytes": 11705,
      "sha256": "200baceff6cd705466882d3119b90fa0b7955d4319b5901ae64b96f7ae10c837",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/reward_tiers.csv",
      "format": "csv",
      "table": "reward_tiers",
      "key": "datasets/customer-loyalty-program-platform/v1/csv/reward_tiers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/csv/reward_tiers.csv",
      "bytes": 1516,
      "sha256": "ae1721acd2ab25b0e168fd41f02ec100146ff5e60309f7b72e38ce41c09ac039",
      "rows": 4,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/transactions.csv",
      "format": "csv",
      "table": "transactions",
      "key": "datasets/customer-loyalty-program-platform/v1/csv/transactions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/csv/transactions.csv",
      "bytes": 22688,
      "sha256": "9dfd26706f013cf2f825667c1b0ab98efff620898de86b69aaa263121f1402ab",
      "rows": 600,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "customer-loyalty-program-platform.json",
      "format": "json",
      "table": null,
      "key": "datasets/customer-loyalty-program-platform/v1/customer-loyalty-program-platform.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/customer-loyalty-program-platform.json",
      "bytes": 236178,
      "sha256": "2d93374f346cbf8c8af6a66967e83730a4b40d4a09db226d011666d1d795e495",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/customer-loyalty-program-platform/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/sql/postgres.sql",
      "bytes": 90399,
      "sha256": "91bb50beaa35c9a3e8d37fadeb33d80731870ec90cadac6e764d22478d82a2d1",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/customer-loyalty-program-platform/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/sql/mysql.sql",
      "bytes": 89747,
      "sha256": "76ce7940a14607928afe0ba1911125d1b984ca0f5d81c2b6cea0cb44e045eeeb",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/customer-loyalty-program-platform/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/sql/mssql.sql",
      "bytes": 92583,
      "sha256": "b45e746e604dd77bdef52cc85d672961c972eead316697c9a198713eb0fb60c1",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/customer-loyalty-program-platform/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/sql/sqlite.sql",
      "bytes": 89581,
      "sha256": "9b2201225be76b3531c27ba5bc063647de348ceb64ae02846f4b0cf3f32fcdf3",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/customer-loyalty-program-platform/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/prisma/seed.ts",
      "bytes": 198632,
      "sha256": "892b1f70c9b194df748b7efebbe0af629da905ae24982c3bd02cc2ebf9861063",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/customer-loyalty-program-platform/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/customer-loyalty-program-platform/v1/django/fixtures.json",
      "bytes": 278561,
      "sha256": "3edd1cd2c00183c66c301babaa68deccb2c956b35adee198ed5e316f25e92231",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788767912243,
  "updatedAt": 1788767912243
}
