{
  "format": "dataset-manifest/1",
  "slug": "transaction-ledger-for-fintech-operations",
  "version": 1,
  "seed": "transaction-ledger-for-fintech-operations:1",
  "spec": {
    "format": "dataset/1",
    "slug": "transaction-ledger-for-fintech-operations",
    "name": "Transaction Ledger for Fintech Operations",
    "tagline": "Invoices, payments, refunds, and merchant profiles related to daily fintech transactions and payment processing.",
    "description": "Merchants facilitate sales and customers make payments through a structured operation involving invoices, payment attempts, refunds, and payouts. This dataset models these daily transactions, allowing users to understand and analyze the flow of funds within a payment processing system. It includes tables for invoices, payments, refunds, merchants, and payment intents, linking them together to form a cohesive ledger. The relationships among these tables enable users to query how payments relate to invoices, track refund processes, and monitor merchant performance over time. This synthetic dataset provides an excellent opportunity for SQL practice and teaching about payment processing systems, illustrating how different components interact within a fintech context. Users can explore trends during peak transaction periods and analyze risk scores associated with different merchants, making it a valuable resource for both developers and educators.",
    "domain": "fintech",
    "shape": "ledger",
    "useCases": [
      "sql-practice",
      "teaching"
    ],
    "keywords": [
      "transactions",
      "payments",
      "invoices",
      "refunds",
      "merchants",
      "fintech",
      "ledger"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "invoices": {
        "description": "Each row represents an invoice issued to a customer, linked to a payment intent. It contains details about the amount and status.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the invoice."
          },
          "customer_id": {
            "kind": "uuid",
            "description": "Unique identifier for the customer associated with the invoice."
          },
          "amount": {
            "kind": "decimal",
            "min": 10,
            "max": 5000,
            "scale": 2,
            "description": "Total amount of the invoice.",
            "nullable": true,
            "when": {
              "column": "status",
              "in": [
                "paid",
                "failed"
              ]
            }
          },
          "status": {
            "kind": "enum",
            "values": [
              "pending",
              "paid",
              "failed"
            ],
            "weights": [
              0.5,
              0.4,
              0.1
            ],
            "description": "Current status of the invoice."
          },
          "created_at": {
            "kind": "datetime",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date and time the invoice was created.",
            "nullable": true,
            "dayProfile": "business"
          }
        }
      },
      "payments": {
        "description": "This table records payment attempts made against invoices, capturing success or failure of transactions.",
        "rows": 300,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the payment attempt."
          },
          "invoice_id": {
            "kind": "fk",
            "ref": "invoices.id",
            "description": "Reference to the invoice associated with this payment."
          },
          "amount": {
            "kind": "decimal",
            "min": 10,
            "max": 5000,
            "scale": 2,
            "description": "Amount processed in the payment attempt.",
            "nullable": true,
            "when": {
              "column": "payment_status",
              "in": [
                "successful",
                "failed"
              ]
            }
          },
          "payment_status": {
            "kind": "enum",
            "values": [
              "successful",
              "failed",
              "pending"
            ],
            "weights": [
              0.7,
              0.2,
              0.1
            ],
            "description": "Status of the payment attempt."
          },
          "attempted_at": {
            "kind": "datetime",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date and time the payment was attempted.",
            "nullable": true,
            "dayProfile": "waking"
          }
        }
      },
      "refunds": {
        "description": "Each row represents a refund issued for a payment, linked to the original payment attempt.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the refund."
          },
          "payment_id": {
            "kind": "fk",
            "ref": "payments.id",
            "description": "Reference to the payment associated with this refund."
          },
          "refund_amount": {
            "kind": "decimal",
            "min": 1,
            "max": 5000,
            "scale": 2,
            "description": "Amount refunded to the customer.",
            "nullable": true,
            "when": {
              "column": "refund_status",
              "in": [
                "processed",
                "failed"
              ]
            }
          },
          "refund_status": {
            "kind": "enum",
            "values": [
              "processed",
              "pending",
              "failed"
            ],
            "weights": [
              0.8,
              0.15,
              0.05
            ],
            "description": "Status of the refund process."
          },
          "refunded_at": {
            "kind": "datetime",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date and time the refund was processed.",
            "nullable": true,
            "dayProfile": "business"
          }
        }
      },
      "merchants": {
        "description": "This table holds information about merchants, including their profiles and risk scores.",
        "rows": 50,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the merchant."
          },
          "name": {
            "kind": "company",
            "description": "Name of the merchant."
          },
          "risk_score": {
            "kind": "int",
            "min": 1,
            "max": 100,
            "description": "Risk score assigned to the merchant based on transaction history.",
            "nullable": true
          },
          "created_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date and time the merchant profile was created.",
            "dayProfile": "business"
          }
        }
      },
      "payment_intents": {
        "description": "This table represents the payment intents generated for invoices, linking to both invoices and merchants.",
        "rows": 250,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for the payment intent."
          },
          "invoice_id": {
            "kind": "fk",
            "ref": "invoices.id",
            "description": "Reference to the invoice associated with this payment intent."
          },
          "merchant_id": {
            "kind": "fk",
            "ref": "merchants.id",
            "description": "Reference to the merchant processing the payment."
          },
          "created_at": {
            "kind": "datetime",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date and time the payment intent was created.",
            "nullable": true,
            "dayProfile": "waking"
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "categorical",
      "timestamped",
      "monetary"
    ],
    "analysisQuestions": [
      "What percentage of invoices are paid successfully?",
      "How do refund rates vary by merchant?",
      "Which merchants have the highest risk scores?",
      "During which months do we see the highest transaction volumes?",
      "What is the average time taken to process refunds?"
    ],
    "suggestedQueries": [
      {
        "title": "Join payments with invoices",
        "sql": "SELECT payments.id, invoices.amount, payments.payment_status FROM payments JOIN invoices ON payments.invoice_id = invoices.id;",
        "dialect": "postgres"
      },
      {
        "title": "Count successful payments by month",
        "sql": "SELECT DATE_TRUNC('month', attempted_at) AS month, COUNT(*) FROM payments WHERE payment_status = 'successful' GROUP BY month ORDER BY month;",
        "dialect": "postgres"
      },
      {
        "title": "Average refund amount by merchant",
        "sql": "SELECT merchants.name, AVG(refunds.refund_amount) FROM refunds JOIN payments ON refunds.payment_id = payments.id JOIN merchants ON payments.merchant_id = merchants.id GROUP BY merchants.name;",
        "dialect": "postgres"
      },
      {
        "title": "Payments and refunds correlation",
        "sql": "SELECT COUNT(payments.id) AS total_payments, COUNT(refunds.id) AS total_refunds FROM payments LEFT JOIN refunds ON payments.id = refunds.payment_id;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Financial Analysts",
        "body": "Financial analysts can utilize this dataset to scrutinize transaction patterns, focusing on the efficiency of payment processing and identifying any discrepancies in refund transactions. They can draw insights on how seasonal trends impact payment volumes and assess merchant performance based on risk scores."
      },
      {
        "title": "Educators in Fintech",
        "body": "Educators teaching fintech concepts can leverage this dataset to provide hands-on SQL practice for students, allowing them to explore real-world scenarios involving payment processing systems. It serves as a practical tool for understanding the interconnections between invoices, payments, and refunds."
      },
      {
        "title": "Developers Building Payment Solutions",
        "body": "Developers aiming to create or improve payment processing solutions can use this dataset to test their systems against various transaction scenarios, including handling multiple payment statuses and refund processes. This can aid in refining their applications to accommodate real-world challenges."
      }
    ]
  },
  "counts": {
    "invoices": 200,
    "merchants": 50,
    "payment_intents": 250,
    "payments": 300,
    "refunds": 100
  },
  "stats": {
    "invoices": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 200
        },
        "amount": {
          "nulls": 94,
          "distinct": 106,
          "min": 79.6,
          "max": 4938.83
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "failed",
          "max": "pending"
        },
        "created_at": {
          "nulls": 12,
          "distinct": 188,
          "min": "2022-01-05 15:13:05",
          "max": "2023-12-26 15:15:41"
        }
      }
    },
    "payments": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "invoice_id": {
          "nulls": 0,
          "distinct": 159,
          "min": 1,
          "max": 199
        },
        "amount": {
          "nulls": 20,
          "distinct": 280,
          "min": 18.97,
          "max": 4998.73
        },
        "payment_status": {
          "nulls": 0,
          "distinct": 3,
          "min": "failed",
          "max": "successful"
        },
        "attempted_at": {
          "nulls": 36,
          "distinct": 264,
          "min": "2022-01-01 09:32:17",
          "max": "2023-12-30 19:33:40"
        }
      }
    },
    "refunds": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "payment_id": {
          "nulls": 0,
          "distinct": 84,
          "min": 7,
          "max": 299
        },
        "refund_amount": {
          "nulls": 15,
          "distinct": 85,
          "min": 128.03,
          "max": 4955.76
        },
        "refund_status": {
          "nulls": 0,
          "distinct": 3,
          "min": "failed",
          "max": "processed"
        },
        "refunded_at": {
          "nulls": 10,
          "distinct": 90,
          "min": "2022-01-03 17:23:38",
          "max": "2023-12-18 15:07:00"
        }
      }
    },
    "merchants": {
      "rows": 50,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 50,
          "min": 1,
          "max": 50
        },
        "name": {
          "nulls": 0,
          "distinct": 50,
          "min": "Acme Holdings",
          "max": "Willow Holdings"
        },
        "risk_score": {
          "nulls": 3,
          "distinct": 33,
          "min": 1,
          "max": 99
        },
        "created_at": {
          "nulls": 0,
          "distinct": 50,
          "min": "2020-01-13 09:55:10",
          "max": "2023-12-26 07:52:48"
        }
      }
    },
    "payment_intents": {
      "rows": 250,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 250,
          "min": 1,
          "max": 250
        },
        "invoice_id": {
          "nulls": 0,
          "distinct": 141,
          "min": 1,
          "max": 200
        },
        "merchant_id": {
          "nulls": 0,
          "distinct": 50,
          "min": 1,
          "max": 50
        },
        "created_at": {
          "nulls": 32,
          "distinct": 218,
          "min": "2022-01-06 12:53:29",
          "max": "2023-12-28 18:44:22"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/invoices.csv",
      "format": "csv",
      "table": "invoices",
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/csv/invoices.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/csv/invoices.csv",
      "bytes": 14357,
      "sha256": "be71657eb90dac092ef8f24496ccfe982c1200747377986ed10dd778e5d19f06",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/merchants.csv",
      "format": "csv",
      "table": "merchants",
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/csv/merchants.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/csv/merchants.csv",
      "bytes": 2067,
      "sha256": "bc2f2824391fc00f385f84ce42001db8c6087c5c6bf29451d9c18649afe6a386",
      "rows": 50,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/payment_intents.csv",
      "format": "csv",
      "table": "payment_intents",
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/csv/payment_intents.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/csv/payment_intents.csv",
      "bytes": 7132,
      "sha256": "a9ddf6940286c1345e4ac891421ce3f2de1d1123a5e0e478279786d40f232fa0",
      "rows": 250,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/payments.csv",
      "format": "csv",
      "table": "payments",
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/csv/payments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/csv/payments.csv",
      "bytes": 13020,
      "sha256": "8a3b87444b9ffc2959a28e0f44743cd10e3d7ab1f26e7872f506569eaf908c6b",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/refunds.csv",
      "format": "csv",
      "table": "refunds",
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/csv/refunds.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/csv/refunds.csv",
      "bytes": 4260,
      "sha256": "48e55800791acf0571765fc90f25ddf6fd0b65e738e165e58c0672c5760ce0df",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "transaction-ledger-for-fintech-operations.json",
      "format": "json",
      "table": null,
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/transaction-ledger-for-fintech-operations.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/transaction-ledger-for-fintech-operations.json",
      "bytes": 135636,
      "sha256": "e376da7f5447c668653aae004c7f2d51677ed55e86f9f296f0677e35b6f8a70f",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/sql/postgres.sql",
      "bytes": 56563,
      "sha256": "72daddbe12c51003aecf952b71a0496559f2a4d22ac695060fff660d5065bdc0",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/sql/mysql.sql",
      "bytes": 55997,
      "sha256": "c54a76858d090339b65248ba0aad20d6a9e867c40ae42a3c995b854094790855",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/sql/mssql.sql",
      "bytes": 57993,
      "sha256": "22422adf2561bb2aecd436283eca7854acfa678caf24394bc0e61740c6c7a1df",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/sql/sqlite.sql",
      "bytes": 55782,
      "sha256": "b2690f95923a38ac2e3ad654e107f2649c30e964781a6aec91e363500b4f966e",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/prisma/seed.ts",
      "bytes": 116508,
      "sha256": "ced509efd9540d64d77a08a7e532e3eb42aa4106dbe051f8e411bd8efb3eefbf",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/transaction-ledger-for-fintech-operations/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/transaction-ledger-for-fintech-operations/v1/django/fixtures.json",
      "bytes": 175684,
      "sha256": "e6f1962198084c1bae721f0b74266965b06427639d6098ed64cd4bd333a8ebde",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788767414590,
  "updatedAt": 1788767414590
}
