{
  "format": "dataset-manifest/1",
  "slug": "card-payments-with-fraud-labels",
  "version": 1,
  "seed": "card-payments-with-fraud-labels:1",
  "spec": {
    "format": "dataset/1",
    "slug": "card-payments-with-fraud-labels",
    "name": "Card Payments with Fraud Labels",
    "tagline": "Synthetic dataset of card transactions with fraud indicators.",
    "description": "Customers make purchases using their cards at various merchants, completing transactions that are recorded and analyzed for patterns and potential fraud. Each transaction captures critical information, such as the amount spent and whether the transaction raised a fraud alert. This business operates within the fintech sector, focusing specifically on card payments and monitoring for fraudulent activities. The nuanced nature of this operation allows for the tracking of transactions over time, providing insights into customer behavior and merchant reliability.\n\nThe relationships among the tables illustrate a comprehensive flow of data from customers to transactions. Each row in the 'customers' table represents a unique individual with their personal details. The 'cards' table links to these customers, indicating which card they use for transactions. Each transaction recorded in the 'transactions' table connects to both a specific customer and a merchant, detailing the amount of the transaction, category, and fraud status. The 'merchants' table categorizes these businesses, while the 'categories' table further segments merchants into various types. Additionally, the 'fraud_alerts' table highlights incidents flagged during the transaction process, providing a clear link to the transactions that triggered warnings.\n\nWith this structured data, developers can explore various queries such as identifying high-risk merchant categories, analyzing customer spending habits, or even evaluating the effectiveness of fraud detection mechanisms. By practicing with this dataset, developers can enhance their skills in data manipulation, querying relationships, and drawing insights from transaction patterns. Keep in mind that all data presented here is synthetic, designed to mirror real-world scenarios while ensuring privacy and security.",
    "domain": "fintech",
    "shape": "transactional",
    "useCases": [
      "analytics-demo",
      "bi-dashboards"
    ],
    "keywords": [
      "card payments",
      "fraud detection",
      "transactions",
      "customers",
      "merchants",
      "synthetic data"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "customers": {
        "description": "This table contains information about customers, including their personal details. Each row represents a unique customer identified by their id, linking to their transactions through their cards.",
        "rows": 500,
        "columns": {
          "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"
            ],
            "unique": true,
            "description": "Customer's email address."
          },
          "phone": {
            "kind": "phone",
            "description": "Customer's phone number."
          },
          "country": {
            "kind": "country",
            "description": "Country of residence for the customer."
          }
        }
      },
      "cards": {
        "description": "This table holds card details for customers, linking to the customers table through customer_id. Each row represents a unique card associated with a customer.",
        "rows": 500,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each card."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.id",
            "description": "Foreign key linking to the customer who owns the card."
          },
          "card_number": {
            "kind": "pattern",
            "pattern": "CARD-#####",
            "description": "Masked card number following a specific pattern."
          },
          "expiry_date": {
            "kind": "date",
            "from": "2025-01-01",
            "to": "2030-12-31",
            "description": "Expiration date of the card.",
            "trend": "seasonal"
          },
          "card_type": {
            "kind": "enum",
            "values": [
              "Visa",
              "MasterCard",
              "American Express"
            ],
            "weights": [
              0.5,
              0.4,
              0.1
            ],
            "description": "Type of card, such as Visa, MasterCard, or American Express."
          }
        }
      },
      "merchants": {
        "description": "This table lists merchants where transactions occur, categorized by type. Each row represents a unique merchant identified by id.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each merchant."
          },
          "merchant_name": {
            "kind": "company",
            "description": "Name of the merchant company."
          },
          "category": {
            "kind": "enum",
            "values": [
              "Electronics",
              "Groceries",
              "Clothing",
              "Travel",
              "Dining"
            ],
            "weights": [
              0.3,
              0.4,
              0.1,
              0.1,
              0.1
            ],
            "description": "Category of the merchant, such as Electronics or Groceries."
          }
        }
      },
      "transactions": {
        "description": "This table records transaction details made using cards, linking to cards and merchants. Each row represents a unique transaction.",
        "rows": 1000,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each transaction."
          },
          "card_id": {
            "kind": "fk",
            "ref": "cards.id",
            "description": "Foreign key linking to the card used for the transaction."
          },
          "merchant_id": {
            "kind": "fk",
            "ref": "merchants.id",
            "description": "Foreign key linking to the merchant where the transaction occurred."
          },
          "amount": {
            "kind": "decimal",
            "min": 1,
            "max": 500,
            "scale": 2,
            "distribution": "long-tail",
            "description": "Transaction amount in decimal format."
          },
          "transaction_date": {
            "kind": "datetime",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "Date and time when the transaction took place.",
            "dayProfile": "waking"
          },
          "is_fraud": {
            "kind": "bool",
            "trueRate": 0.02,
            "description": "Indicates whether the transaction is labeled as fraudulent."
          }
        }
      },
      "fraud_alerts": {
        "description": "This table contains alerts related to fraudulent transactions, linking to the transactions table. Each row represents a unique fraud alert.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each fraud alert."
          },
          "transaction_id": {
            "kind": "fk",
            "ref": "transactions.id",
            "description": "Foreign key linking to the transaction that triggered the alert."
          },
          "alert_date": {
            "kind": "datetime",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "Date and time when the alert was generated.",
            "dayProfile": "waking"
          },
          "alert_reason": {
            "kind": "sentence",
            "min": 10,
            "max": 50,
            "description": "Reason for generating the fraud alert."
          }
        }
      },
      "categories": {
        "description": "This table defines categories of merchants, linking to the merchants table. Each row represents a unique category.",
        "rows": 5,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each category."
          },
          "category_name": {
            "kind": "enum",
            "values": [
              "Electronics",
              "Groceries",
              "Clothing",
              "Travel",
              "Dining"
            ],
            "unique": true,
            "description": "Name of the merchant category, such as Electronics or Groceries."
          }
        }
      }
    },
    "suggestedQueries": [
      {
        "title": "Join Transactions and Merchants",
        "sql": "SELECT t.id, t.amount, m.merchant_name FROM transactions t JOIN merchants m ON t.merchant_id = m.id;",
        "dialect": "postgres"
      },
      {
        "title": "Total Amount by Merchant Category",
        "sql": "SELECT m.category, SUM(t.amount) AS total_amount FROM transactions t JOIN merchants m ON t.merchant_id = m.id GROUP BY m.category;",
        "dialect": "postgres"
      },
      {
        "title": "Fraudulent Transactions Count by Card Type",
        "sql": "SELECT c.card_type, COUNT(t.id) AS fraud_count FROM transactions t JOIN cards c ON t.card_id = c.id WHERE t.is_fraud = TRUE GROUP BY c.card_type;",
        "dialect": "postgres"
      },
      {
        "title": "Daily Transaction Amounts with Window Function",
        "sql": "SELECT transaction_date::date AS date, SUM(amount) OVER (ORDER BY transaction_date::date) AS cumulative_amount FROM transactions;",
        "dialect": "postgres"
      },
      {
        "title": "Monthly Fraud Alerts Count",
        "sql": "SELECT DATE_TRUNC('month', fa.alert_date) AS month, COUNT(fa.id) AS alert_count FROM fraud_alerts fa GROUP BY month ORDER BY month;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Fraud Detection Analysis",
        "body": "Fraud analysts would use this dataset to identify patterns in fraudulent transactions. By examining the transaction amounts and the reasons for fraud alerts, they can pinpoint which merchants or card types are more susceptible to fraud. This analysis helps in refining detection algorithms and enhancing security measures for card transactions."
      },
      {
        "title": "Customer Spending Insights",
        "body": "Marketing teams may reach for this data to understand customer spending behaviors. By analyzing transaction amounts across different merchants and categories, they can tailor promotional campaigns to specific customer segments. For instance, if a significant amount is spent in dining, targeted offers can be created to encourage more spending in that category."
      },
      {
        "title": "Merchant Performance Evaluation",
        "body": "Business analysts might utilize this dataset to evaluate the performance of various merchants. By aggregating transaction amounts by merchant category, they can identify which types of merchants are thriving and which are lagging. This information is crucial for strategic partnerships and investment decisions."
      },
      {
        "title": "Risk Assessment for New Customers",
        "body": "Risk management teams could leverage this dataset to assess the potential risk of new customers based on their transaction history. By analyzing the frequency and amount of transactions, along with any associated fraud alerts, they can better understand the risk profile of customers and make informed decisions on credit limits and approvals."
      }
    ],
    "analysisQuestions": [
      "Which merchants have the highest transaction amounts?",
      "What percentage of transactions are flagged as fraudulent?",
      "How does transaction volume vary by day of the week?",
      "What are the common reasons for fraud alerts?"
    ]
  },
  "counts": {
    "categories": 5,
    "customers": 500,
    "cards": 500,
    "merchants": 100,
    "transactions": 1000,
    "fraud_alerts": 100
  },
  "stats": {
    "customers": {
      "rows": 500,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 500,
          "min": 1,
          "max": 500
        },
        "first_name": {
          "nulls": 0,
          "distinct": 79,
          "min": "Alice",
          "max": "Zoe"
        },
        "last_name": {
          "nulls": 0,
          "distinct": 80,
          "min": "Adams",
          "max": "Zhang"
        },
        "email": {
          "nulls": 0,
          "distinct": 500
        },
        "phone": {
          "nulls": 0,
          "distinct": 445
        },
        "country": {
          "nulls": 0,
          "distinct": 43,
          "min": "Argentina",
          "max": "United States"
        }
      }
    },
    "cards": {
      "rows": 500,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 500,
          "min": 1,
          "max": 500
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 314,
          "min": 1,
          "max": 500
        },
        "card_number": {
          "nulls": 0,
          "distinct": 500
        },
        "expiry_date": {
          "nulls": 0,
          "distinct": 446,
          "min": "2025-01-15",
          "max": "2030-12-30"
        },
        "card_type": {
          "nulls": 0,
          "distinct": 3,
          "min": "American Express",
          "max": "Visa"
        }
      }
    },
    "merchants": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "merchant_name": {
          "nulls": 0,
          "distinct": 95,
          "min": "Acme Energy",
          "max": "Willow Industries"
        },
        "category": {
          "nulls": 0,
          "distinct": 5,
          "min": "Clothing",
          "max": "Travel"
        }
      }
    },
    "transactions": {
      "rows": 1000,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 1000,
          "min": 1,
          "max": 1000
        },
        "card_id": {
          "nulls": 0,
          "distinct": 438,
          "min": 1,
          "max": 500
        },
        "merchant_id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "amount": {
          "nulls": 0,
          "distinct": 971,
          "min": 1,
          "max": 499.45
        },
        "transaction_date": {
          "nulls": 0,
          "distinct": 1000,
          "min": "2023-01-01 18:03:27",
          "max": "2023-12-31 17:21:25"
        },
        "is_fraud": {
          "nulls": 0,
          "distinct": 2,
          "min": "false",
          "max": "true"
        }
      }
    },
    "fraud_alerts": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "transaction_id": {
          "nulls": 0,
          "distinct": 95,
          "min": 18,
          "max": 972
        },
        "alert_date": {
          "nulls": 0,
          "distinct": 100,
          "min": "2023-01-02 19:45:05",
          "max": "2023-12-30 15:57:00"
        },
        "alert_reason": {
          "nulls": 0,
          "distinct": 100
        }
      }
    },
    "categories": {
      "rows": 5,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 5,
          "min": 1,
          "max": 5
        },
        "category_name": {
          "nulls": 0,
          "distinct": 5,
          "min": "Clothing",
          "max": "Travel"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/categories.csv",
      "format": "csv",
      "table": "categories",
      "key": "datasets/card-payments-with-fraud-labels/v1/csv/categories.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/csv/categories.csv",
      "bytes": 78,
      "sha256": "979aabd288f2e026b0d1f63bf606e81c1d4f96da11e6934b97724bbfa5734184",
      "rows": 5,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/customers.csv",
      "format": "csv",
      "table": "customers",
      "key": "datasets/card-payments-with-fraud-labels/v1/csv/customers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/csv/customers.csv",
      "bytes": 33089,
      "sha256": "c2cffc93ec4965aa326b4eae7b9174636f93cbad1936db1e5dff3ac5abdc39ae",
      "rows": 500,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/cards.csv",
      "format": "csv",
      "table": "cards",
      "key": "datasets/card-payments-with-fraud-labels/v1/csv/cards.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/csv/cards.csv",
      "bytes": 19606,
      "sha256": "bccf30eff4c44bd1fe890fa41669d38c81719d0ca69a1109b215971b519504ba",
      "rows": 500,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/merchants.csv",
      "format": "csv",
      "table": "merchants",
      "key": "datasets/card-payments-with-fraud-labels/v1/csv/merchants.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/csv/merchants.csv",
      "bytes": 2785,
      "sha256": "c2dffc69e9e39943f29d0fd084b510bea1943afbc1d95f1b39558f74341275b4",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/transactions.csv",
      "format": "csv",
      "table": "transactions",
      "key": "datasets/card-payments-with-fraud-labels/v1/csv/transactions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/csv/transactions.csv",
      "bytes": 44051,
      "sha256": "f9237f1a127a51bebd890aa61218b7b26d9abb472c0dc852f66c4c83f08bf1ad",
      "rows": 1000,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/fraud_alerts.csv",
      "format": "csv",
      "table": "fraud_alerts",
      "key": "datasets/card-payments-with-fraud-labels/v1/csv/fraud_alerts.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/csv/fraud_alerts.csv",
      "bytes": 8430,
      "sha256": "12697bc43d4b689ef0f576156b7eedd9b258269068608360d1aa13bb0a27a002",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "card-payments-with-fraud-labels.json",
      "format": "json",
      "table": null,
      "key": "datasets/card-payments-with-fraud-labels/v1/card-payments-with-fraud-labels.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/card-payments-with-fraud-labels.json",
      "bytes": 374313,
      "sha256": "1a9ade3e9a9665104e19b0fa9080318fbe218c72a2bdc2feaa6b9cb11c1e8082",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/card-payments-with-fraud-labels/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/sql/postgres.sql",
      "bytes": 145857,
      "sha256": "389b29ea72e4dd2d52a398ead8245a8b52ce917deea190d63234b0ede065dd25",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/card-payments-with-fraud-labels/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/sql/mysql.sql",
      "bytes": 141209,
      "sha256": "9cce9e840aed1d2cafdc60c3ceee907402a5ded88587367022e149cdc28739be",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/card-payments-with-fraud-labels/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/sql/mssql.sql",
      "bytes": 147012,
      "sha256": "ffc60f6fd85be5a441c04c96bac796abbff1f446bfcba51e95d50438b07d612e",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/card-payments-with-fraud-labels/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/sql/sqlite.sql",
      "bytes": 140958,
      "sha256": "1d97902b4175c67d06ae7e6833a2a2a5d6d477ce0d2cdeea5dca032948a5faea",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/card-payments-with-fraud-labels/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/prisma/seed.ts",
      "bytes": 300766,
      "sha256": "4f28f93fb05da77df3d8f0c3be43fd6564b9669172f1bd48d3cac292237036c8",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/card-payments-with-fraud-labels/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/card-payments-with-fraud-labels/v1/django/fixtures.json",
      "bytes": 470041,
      "sha256": "d26c642ce7c9cd3f0c3b9a18b5864559b8da90889c15b082fa4b78c3b078fd4e",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788768569905,
  "updatedAt": 1788768569905
}
