{
  "format": "dataset-manifest/1",
  "slug": "transaction-trail",
  "version": 2,
  "seed": "transaction-trail:1",
  "spec": {
    "format": "dataset/1",
    "slug": "transaction-trail",
    "name": "Transaction Trail",
    "tagline": "Accounts, transactions, payment methods, and anomalies documenting financial activities and account health.",
    "description": "Transactions occur daily as individuals and businesses engage in various financial activities, affecting their account balances and payment methods. Each transaction is recorded with details that include amounts, timestamps, and the payment methods used, offering a nuanced view of the financial landscape. Account balances are updated in real time, reflecting the immediate impact of these transactions on the financial health of users. Anomalies emerge in the data, representing unusual transactions that deviate from normal patterns, highlighting the need for attention in financial monitoring and fraud detection.\n\nThe tables in this dataset interconnect to present a coherent picture of financial activity. Each row in the accounts table corresponds to a unique account holder, detailing their account number and current balance. The transactions table captures individual transaction entries, linking back to the accounts table via account numbers, thereby tracing the flow of money. The payment_methods table enumerates the various ways users can conduct transactions, be it through credit cards, bank transfers, or digital wallets, while the transaction_status table indicates whether each transaction has been completed, pending, or failed. Anomalies are flagged within the transactions table, allowing for quick identification of irregularities that warrant further investigation.\n\nThis dataset answers critical questions about financial behavior: What are the most common payment methods used? How do account balances change over time with different transaction types? What patterns emerge from the anomalies spotted in the data? These insights can help developers practice data manipulation, analysis, and visualization techniques, equipping them with the skills necessary to handle real-world financial data scenarios. Keep in mind that the data provided here is synthetic, generated to assist in honing your analytical abilities without the constraints of real-world privacy concerns.",
    "domain": "fintech",
    "shape": "ledger",
    "useCases": [
      "sql-practice",
      "teaching"
    ],
    "keywords": [
      "transactions",
      "finance",
      "accounts",
      "payment methods",
      "timestamp",
      "ledger"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "accounts": {
        "description": "This table records the details of user accounts including balance and account type. Each row links to multiple transactions.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each account."
          },
          "user_name": {
            "kind": "fullName",
            "description": "The full name of the account holder."
          },
          "balance": {
            "kind": "decimal",
            "min": 0,
            "max": 1000000,
            "scale": 2,
            "description": "Current balance of the account.",
            "distribution": "heavy-tail"
          },
          "account_type": {
            "kind": "enum",
            "values": [
              "checking",
              "savings",
              "credit"
            ],
            "description": "Type of the account.",
            "weights": [
              6,
              3,
              1
            ]
          },
          "created_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the account was created.",
            "dayProfile": "business"
          }
        }
      },
      "transactions": {
        "description": "Records the details of each transaction made by users, linking back to the accounts table.",
        "rows": 800,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each transaction."
          },
          "account_id": {
            "kind": "fk",
            "ref": "accounts.id",
            "description": "Reference to the account associated with this transaction."
          },
          "amount": {
            "kind": "decimal",
            "min": -100000,
            "max": 100000,
            "scale": 2,
            "description": "Amount of money transacted, negative for withdrawals.",
            "distribution": "long-tail"
          },
          "transaction_type": {
            "kind": "enum",
            "values": [
              "deposit",
              "withdrawal",
              "transfer"
            ],
            "description": "Type of the transaction.",
            "weights": [
              5,
              4,
              1
            ]
          },
          "timestamp": {
            "kind": "datetime",
            "from": "2021-01-01",
            "to": "2023-12-31",
            "description": "Date and time when the transaction occurred.",
            "dayProfile": "waking"
          }
        }
      },
      "payment_methods": {
        "description": "Details the different payment methods available for transactions, linking to the transactions table.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each payment method."
          },
          "method_name": {
            "kind": "enum",
            "values": [
              "credit card",
              "debit card",
              "bank transfer",
              "paypal"
            ],
            "description": "Name of the payment method."
          },
          "transaction_id": {
            "kind": "fk",
            "ref": "transactions.id",
            "nullable": true,
            "description": "Reference to the transaction using this payment method."
          }
        }
      },
      "transaction_status": {
        "description": "Stores the status of each transaction, linking back to the transactions table.",
        "rows": 800,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the transaction status."
          },
          "transaction_id": {
            "kind": "fk",
            "ref": "transactions.id",
            "description": "Reference to the transaction whose status is recorded."
          },
          "status": {
            "kind": "enum",
            "values": [
              "pending",
              "completed",
              "failed"
            ],
            "description": "Current status of the transaction.",
            "weights": [
              2,
              7,
              1
            ]
          },
          "updated_at": {
            "kind": "datetime",
            "from": "2021-01-01",
            "to": "2023-12-31",
            "description": "Date and time when the status was last updated.",
            "dayProfile": "business"
          }
        }
      },
      "anomalies": {
        "description": "Records high-value or unusual transactions that may require further investigation.",
        "rows": 50,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each anomaly record."
          },
          "transaction_id": {
            "kind": "fk",
            "ref": "transactions.id",
            "description": "Reference to the transaction identified as an anomaly."
          },
          "reason": {
            "kind": "sentence",
            "description": "Reason for the transaction being flagged as an anomaly."
          },
          "flagged_at": {
            "kind": "datetime",
            "from": "2021-01-01",
            "to": "2023-12-31",
            "description": "Date and time when the anomaly was flagged.",
            "dayProfile": "business"
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "monetary",
      "timestamped",
      "categorical",
      "high-cardinality"
    ],
    "analysisQuestions": [
      "What are the most common transaction types and their frequencies?",
      "How do transaction amounts vary by account type over time?",
      "What payment methods are most frequently used for deposits?",
      "Are there specific times when transactions are more likely to fail?",
      "What patterns can be observed in high-value transactions?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Accounts and Transactions",
        "sql": "SELECT a.user_name, t.amount, t.transaction_type FROM accounts a JOIN transactions t ON a.id = t.account_id;",
        "dialect": "postgres"
      },
      {
        "title": "Aggregate Transactions by Type",
        "sql": "SELECT t.transaction_type, COUNT(*) AS count FROM transactions t GROUP BY t.transaction_type;",
        "dialect": "postgres"
      },
      {
        "title": "Transaction Amounts by Account Type",
        "sql": "SELECT a.account_type, AVG(t.amount) AS average_amount FROM accounts a JOIN transactions t ON a.id = t.account_id GROUP BY a.account_type;",
        "dialect": "postgres"
      },
      {
        "title": "Count Anomalies by Reason",
        "sql": "SELECT reason, COUNT(*) AS anomaly_count FROM anomalies GROUP BY reason;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Financial Analyst Using the Dataset",
        "body": "A financial analyst can utilize this dataset to assess the overall transaction trends within different account types. They may focus on anomalies in transaction data or explore the relationship between transaction types and payment methods to identify potential areas for improvement in user experience."
      },
      {
        "title": "Educator Creating Teaching Materials",
        "body": "An educator teaching finance or data analysis can leverage this dataset to create hands-on exercises for students. They can craft assignments that require students to analyze transaction behaviors, explore relationships between account types and transactions, or even build reports based on the data provided."
      },
      {
        "title": "Software Developer Testing a Financial Application",
        "body": "A software developer working on a financial application can use this dataset to simulate real-world scenarios. They can implement features such as transaction tracking, payment processing, and anomaly detection, ensuring that their application handles various transaction types and statuses effectively."
      },
      {
        "title": "Data Scientist Exploring Transaction Patterns",
        "body": "A data scientist can explore this dataset to uncover patterns in financial transactions. By analyzing transaction amounts, types, and associated anomalies, they can create predictive models that help in detecting fraudulent activities or forecasting future transaction behaviors."
      }
    ]
  },
  "counts": {
    "accounts": 200,
    "transactions": 800,
    "anomalies": 50,
    "payment_methods": 100,
    "transaction_status": 800
  },
  "stats": {
    "accounts": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "user_name": {
          "nulls": 0,
          "distinct": 196,
          "min": "Alice Ibrahim",
          "max": "Zoe Rossi"
        },
        "balance": {
          "nulls": 0,
          "distinct": 199,
          "min": 0,
          "max": 998172.95
        },
        "account_type": {
          "nulls": 0,
          "distinct": 3,
          "min": "checking",
          "max": "savings"
        },
        "created_at": {
          "nulls": 0,
          "distinct": 200,
          "min": "2020-01-01 10:34:26",
          "max": "2023-12-03 14:07:01"
        }
      }
    },
    "transactions": {
      "rows": 800,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 800,
          "min": 1,
          "max": 800
        },
        "account_id": {
          "nulls": 0,
          "distinct": 197,
          "min": 1,
          "max": 200
        },
        "amount": {
          "nulls": 0,
          "distinct": 800,
          "min": -99998.77,
          "max": 98152.69
        },
        "transaction_type": {
          "nulls": 0,
          "distinct": 3,
          "min": "deposit",
          "max": "withdrawal"
        },
        "timestamp": {
          "nulls": 0,
          "distinct": 800,
          "min": "2021-01-02 20:49:32",
          "max": "2023-12-31 05:15:32"
        }
      }
    },
    "payment_methods": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "method_name": {
          "nulls": 0,
          "distinct": 4,
          "min": "bank transfer",
          "max": "paypal"
        },
        "transaction_id": {
          "nulls": 11,
          "distinct": 83,
          "min": 3,
          "max": 799
        }
      }
    },
    "transaction_status": {
      "rows": 800,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 800,
          "min": 1,
          "max": 800
        },
        "transaction_id": {
          "nulls": 0,
          "distinct": 503,
          "min": 1,
          "max": 798
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "completed",
          "max": "pending"
        },
        "updated_at": {
          "nulls": 0,
          "distinct": 800,
          "min": "2021-01-02 08:53:48",
          "max": "2023-12-31 16:25:20"
        }
      }
    },
    "anomalies": {
      "rows": 50,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 50,
          "min": 1,
          "max": 50
        },
        "transaction_id": {
          "nulls": 0,
          "distinct": 49,
          "min": 15,
          "max": 794
        },
        "reason": {
          "nulls": 0,
          "distinct": 50
        },
        "flagged_at": {
          "nulls": 0,
          "distinct": 50,
          "min": "2021-01-10 09:09:43",
          "max": "2023-12-30 14:18:52"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/accounts.csv",
      "format": "csv",
      "table": "accounts",
      "key": "datasets/transaction-trail/v2/csv/accounts.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/csv/accounts.csv",
      "bytes": 10875,
      "sha256": "57e1ba5ee60f751d435ba8cde449fe46eb7483933c63e5f78d80251d09be96a0",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/transactions.csv",
      "format": "csv",
      "table": "transactions",
      "key": "datasets/transaction-trail/v2/csv/transactions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/csv/transactions.csv",
      "bytes": 37863,
      "sha256": "a11516dac1b4848522e0316085790aaddf0b8733b13b9c407c5e9634d92bb181",
      "rows": 800,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/anomalies.csv",
      "format": "csv",
      "table": "anomalies",
      "key": "datasets/transaction-trail/v2/csv/anomalies.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/csv/anomalies.csv",
      "bytes": 4253,
      "sha256": "baeb1b6b9f376bf5be547b3470f003836e3d4714ec8d467f9643fd78a8365a9d",
      "rows": 50,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/payment_methods.csv",
      "format": "csv",
      "table": "payment_methods",
      "key": "datasets/transaction-trail/v2/csv/payment_methods.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/csv/payment_methods.csv",
      "bytes": 1883,
      "sha256": "985f7fcf4048eda331639aa926552869f55476a2f1d50c11e7d9617c44a89949",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/transaction_status.csv",
      "format": "csv",
      "table": "transaction_status",
      "key": "datasets/transaction-trail/v2/csv/transaction_status.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/csv/transaction_status.csv",
      "bytes": 30497,
      "sha256": "6b315c7fa953b4b6a878249a46dfb382cc220496e4307a1a8fa1957955802863",
      "rows": 800,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "transaction-trail.json",
      "format": "json",
      "table": null,
      "key": "datasets/transaction-trail/v2/transaction-trail.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/transaction-trail.json",
      "bytes": 282619,
      "sha256": "994b2d682982484608ca04bac71d31f742d1ba98885a575804947e3e2604702b",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/transaction-trail/v2/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/sql/postgres.sql",
      "bytes": 115067,
      "sha256": "5853133944bb5f32cef7ffb51c81ef063738fed8ad0b768ef842611ede9eaf99",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/transaction-trail/v2/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/sql/mysql.sql",
      "bytes": 114472,
      "sha256": "c006c9d3b1d28fb49fd2484463fa190f462fd8f76ae1bcf22139a2b902befa37",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/transaction-trail/v2/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/sql/mssql.sql",
      "bytes": 118839,
      "sha256": "04de786de38eef8c3c347ac7ed513e544b4d50861c21c94d4bdbcd26d4c319fd",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/transaction-trail/v2/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/sql/sqlite.sql",
      "bytes": 114224,
      "sha256": "0754edbc6023a9d5d9be8776e67651944d2a9f331883a85b0718a67b315486b2",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/transaction-trail/v2/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/prisma/seed.ts",
      "bytes": 244395,
      "sha256": "82eb427771d92c9e46dee01ccd1257b412da3e0a4d48078e7f6d0d644de72e82",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/transaction-trail/v2/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-trail/v2/django/fixtures.json",
      "bytes": 378842,
      "sha256": "f9be12e60a13fb7f54bb4883d3cfb425fb7475cea1a9b616937d8e638578147b",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788734359371,
  "updatedAt": 1788786490209
}
