{
  "format": "dataset-manifest/1",
  "slug": "retail-bank-accounts",
  "version": 1,
  "seed": "retail-bank-accounts:1",
  "spec": {
    "format": "dataset/1",
    "slug": "retail-bank-accounts",
    "name": "Retail Bank Accounts",
    "tagline": "A synthetic dataset for modeling retail banking operations.",
    "description": "A retail bank serves a diverse clientele, providing various financial services such as personal and business accounts, transactions, and automatic payments. Customers visit branches to manage their accounts, deposit funds, withdraw cash, and set up standing orders for regular payments. Each branch operates as a local hub for customer interactions, catering to the unique needs of the community it serves. Customers can hold multiple accounts across branches, allowing for flexibility and convenience in managing their finances.\n\nIn this dataset, the 'customers' table contains information about individual account holders, detailing their personal profiles and account relationships. The 'branches' table lists all operational branches, including their locations and services offered. The 'accounts' table connects customers to their various accounts, detailing account types and statuses. The 'transactions' table provides a record of all financial activities, showing running balances and the flow of money in and out of accounts. Meanwhile, the 'standing_orders' table tracks automatic payment instructions set by customers for recurring expenses.\n\nThe relationships between these tables create a rich landscape for analysis. For instance, one can easily link customers to their respective accounts and the branches where those accounts are held. Each transaction can be traced back to both the customer and the specific account affected, while standing orders can be analyzed in the context of a customer’s spending habits.\n\nThis dataset enables practitioners to explore questions such as customer behavior patterns, branch performance metrics, and the impact of standing orders on account balances. Developers can practice querying connections between tables, filtering data to derive insights, and generating reports that reflect banking operations. Note that all data within this dataset is synthetic, designed solely for practice and learning purposes.",
    "domain": "banking",
    "shape": "transactional",
    "useCases": [
      "sql-practice",
      "teaching"
    ],
    "keywords": [
      "banking",
      "customers",
      "accounts",
      "transactions",
      "standing orders",
      "branches"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "customers": {
        "description": "This table contains information about customers of the bank. Each row represents a unique customer identified by customer_id, including their personal details and the branch they are associated with, if applicable.",
        "rows": 200,
        "columns": {
          "customer_id": {
            "kind": "pk",
            "description": "Unique identifier for each customer."
          },
          "first_name": {
            "kind": "firstName",
            "description": "First name of the customer."
          },
          "last_name": {
            "kind": "lastName",
            "description": "Last name of the customer."
          },
          "email": {
            "kind": "email",
            "from": [
              "first_name",
              "last_name"
            ],
            "unique": true,
            "description": "Email address of the customer."
          },
          "phone": {
            "kind": "phone",
            "nullable": true,
            "description": "Phone number of the customer, optional."
          },
          "branch_id": {
            "kind": "fk",
            "ref": "branches.branch_id",
            "nullable": true,
            "description": "Identifier for the branch associated with the customer, optional."
          }
        }
      },
      "branches": {
        "description": "This table lists the bank branches, with each row representing a unique branch identified by branch_id. It includes the branch name and its location.",
        "rows": 10,
        "columns": {
          "branch_id": {
            "kind": "pk",
            "description": "Unique identifier for each branch."
          },
          "branch_name": {
            "kind": "words",
            "min": 2,
            "max": 3,
            "description": "Name of the branch."
          },
          "location": {
            "kind": "city",
            "description": "City where the branch is located."
          }
        }
      },
      "accounts": {
        "description": "This table contains bank accounts held by customers. Each row represents an account identified by account_id, linking to the customer and detailing the type of account, balance, and opening date.",
        "rows": 300,
        "columns": {
          "account_id": {
            "kind": "pk",
            "description": "Unique identifier for each account."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.customer_id",
            "description": "Identifier for the customer who owns the account."
          },
          "account_type": {
            "kind": "enum",
            "values": [
              "savings",
              "checking",
              "business"
            ],
            "weights": [
              0.5,
              0.4,
              0.1
            ],
            "description": "Type of account (savings, checking, or business)."
          },
          "balance": {
            "kind": "decimal",
            "min": 0,
            "max": 100000,
            "scale": 2,
            "distribution": "long-tail",
            "description": "Current balance of the account."
          },
          "open_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "Date when the account was opened."
          }
        }
      },
      "transactions": {
        "description": "This table records all transactions made on accounts. Each row represents a unique transaction identified by transaction_id, detailing the account involved, transaction date, amount, type, and running balance after the transaction.",
        "rows": 1000,
        "columns": {
          "transaction_id": {
            "kind": "pk",
            "description": "Unique identifier for each transaction."
          },
          "account_id": {
            "kind": "fk",
            "ref": "accounts.account_id",
            "description": "Identifier for the account associated with the transaction."
          },
          "transaction_date": {
            "kind": "datetime",
            "dayProfile": "business",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "Date and time when the transaction occurred."
          },
          "amount": {
            "kind": "decimal",
            "min": -5000,
            "max": 5000,
            "scale": 2,
            "distribution": "normal",
            "description": "Amount of money involved in the transaction."
          },
          "transaction_type": {
            "kind": "enum",
            "values": [
              "deposit",
              "withdrawal"
            ],
            "weights": [
              0.6,
              0.4
            ],
            "description": "Type of transaction (deposit or withdrawal)."
          },
          "running_balance": {
            "kind": "decimal",
            "min": 0,
            "max": 100000,
            "scale": 2,
            "description": "Balance of the account after the transaction."
          }
        }
      },
      "standing_orders": {
        "description": "This table contains details of standing orders set up by customers. Each row represents a unique standing order identified by standing_order_id, linking to the account, and detailing the amount, frequency, and duration of the order.",
        "rows": 150,
        "columns": {
          "standing_order_id": {
            "kind": "pk",
            "description": "Unique identifier for each standing order."
          },
          "account_id": {
            "kind": "fk",
            "ref": "accounts.account_id",
            "description": "Identifier for the account associated with the standing order."
          },
          "amount": {
            "kind": "decimal",
            "min": 10,
            "max": 1000,
            "scale": 2,
            "description": "Amount of money for the standing order."
          },
          "frequency": {
            "kind": "enum",
            "values": [
              "weekly",
              "monthly",
              "annually"
            ],
            "weights": [
              0.5,
              0.4,
              0.1
            ],
            "description": "Frequency of the standing order (weekly, monthly, or annually)."
          },
          "start_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "Date when the standing order starts."
          },
          "end_date": {
            "kind": "date",
            "after": "start_date",
            "withinDays": 365,
            "description": "Date when the standing order ends."
          }
        }
      }
    },
    "suggestedQueries": [
      {
        "title": "Join Customers and Accounts",
        "sql": "SELECT c.first_name, c.last_name, a.account_id FROM customers c JOIN accounts a ON c.customer_id = a.customer_id;",
        "dialect": "postgres"
      },
      {
        "title": "Aggregate Account Balances by Type",
        "sql": "SELECT account_type, AVG(balance) as average_balance FROM accounts GROUP BY account_type;",
        "dialect": "postgres"
      },
      {
        "title": "Transaction Count by Type",
        "sql": "SELECT transaction_type, COUNT(*) as transaction_count FROM transactions GROUP BY transaction_type;",
        "dialect": "postgres"
      },
      {
        "title": "Running Balance Over Time",
        "sql": "SELECT transaction_date, running_balance FROM transactions WHERE account_id = 1 ORDER BY transaction_date;",
        "dialect": "postgres"
      },
      {
        "title": "Standing Orders Frequency Analysis",
        "sql": "SELECT frequency, SUM(amount) as total_amount FROM standing_orders GROUP BY frequency;",
        "dialect": "postgres"
      },
      {
        "title": "Transactions in a Date Range",
        "sql": "SELECT * FROM transactions WHERE transaction_date BETWEEN '2023-01-01' AND '2023-12-31';",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Customer Service Inquiry",
        "body": "A customer service representative may reach for this dataset to assist a customer who is inquiring about their account balance and transaction history. By accessing the accounts and transactions tables, they can quickly provide detailed information about the customer's account status and recent activities, ensuring a smooth and informative interaction."
      },
      {
        "title": "Branch Performance Analysis",
        "body": "A bank manager could utilize this dataset to analyze the performance of different branches. By examining transaction volumes and account types across branches, they can identify trends and make informed decisions regarding resource allocation or marketing strategies to enhance branch performance and customer engagement."
      },
      {
        "title": "Financial Planning for Customers",
        "body": "A financial advisor may use this dataset to help clients set up standing orders for savings or investments. By reviewing the standing_orders table, they can recommend appropriate frequencies and amounts based on the client's financial goals, ensuring that the clients have a structured approach to their savings."
      }
    ],
    "analysisQuestions": [
      "Which account types are most popular among customers?",
      "How do transaction volumes vary by branch location?",
      "What is the average balance for accounts opened within the last year?"
    ]
  },
  "counts": {
    "branches": 10,
    "customers": 200,
    "accounts": 300,
    "standing_orders": 150,
    "transactions": 1000
  },
  "stats": {
    "customers": {
      "rows": 200,
      "columns": {
        "customer_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "first_name": {
          "nulls": 0,
          "distinct": 73,
          "min": "Amir",
          "max": "Zoe"
        },
        "last_name": {
          "nulls": 0,
          "distinct": 74,
          "min": "Adams",
          "max": "Young"
        },
        "email": {
          "nulls": 0,
          "distinct": 200
        },
        "phone": {
          "nulls": 27,
          "distinct": 170
        },
        "branch_id": {
          "nulls": 25,
          "distinct": 10,
          "min": 1,
          "max": 10
        }
      }
    },
    "branches": {
      "rows": 10,
      "columns": {
        "branch_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "branch_name": {
          "nulls": 0,
          "distinct": 10
        },
        "location": {
          "nulls": 0,
          "distinct": 9,
          "min": "Auckland",
          "max": "Zurich"
        }
      }
    },
    "accounts": {
      "rows": 300,
      "columns": {
        "account_id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 151,
          "min": 1,
          "max": 198
        },
        "account_type": {
          "nulls": 0,
          "distinct": 3,
          "min": "business",
          "max": "savings"
        },
        "balance": {
          "nulls": 0,
          "distinct": 300,
          "min": 2.13,
          "max": 98923.41
        },
        "open_date": {
          "nulls": 0,
          "distinct": 267,
          "min": "2020-01-02",
          "max": "2022-12-27"
        }
      }
    },
    "transactions": {
      "rows": 1000,
      "columns": {
        "transaction_id": {
          "nulls": 0,
          "distinct": 1000,
          "min": 1,
          "max": 1000
        },
        "account_id": {
          "nulls": 0,
          "distinct": 293,
          "min": 1,
          "max": 299
        },
        "transaction_date": {
          "nulls": 0,
          "distinct": 1000,
          "min": "2023-01-01 02:04:14",
          "max": "2023-12-31 14:37:07"
        },
        "amount": {
          "nulls": 0,
          "distinct": 998,
          "min": -3975.48,
          "max": 3888.39
        },
        "transaction_type": {
          "nulls": 0,
          "distinct": 2,
          "min": "deposit",
          "max": "withdrawal"
        },
        "running_balance": {
          "nulls": 0,
          "distinct": 1000,
          "min": 106.5,
          "max": 99913.28
        }
      }
    },
    "standing_orders": {
      "rows": 150,
      "columns": {
        "standing_order_id": {
          "nulls": 0,
          "distinct": 150,
          "min": 1,
          "max": 150
        },
        "account_id": {
          "nulls": 0,
          "distinct": 122,
          "min": 2,
          "max": 300
        },
        "amount": {
          "nulls": 0,
          "distinct": 150,
          "min": 10.43,
          "max": 996.66
        },
        "frequency": {
          "nulls": 0,
          "distinct": 3,
          "min": "annually",
          "max": "weekly"
        },
        "start_date": {
          "nulls": 0,
          "distinct": 128,
          "min": "2023-01-02",
          "max": "2023-12-26"
        },
        "end_date": {
          "nulls": 0,
          "distinct": 129,
          "min": "2023-02-08",
          "max": "2024-12-04"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/branches.csv",
      "format": "csv",
      "table": "branches",
      "key": "datasets/retail-bank-accounts/v1/csv/branches.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/csv/branches.csv",
      "bytes": 313,
      "sha256": "50d6457c77590205b9d1b0986c0e33a8e44e58726939138ead4356e741fe9db6",
      "rows": 10,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/customers.csv",
      "format": "csv",
      "table": "customers",
      "key": "datasets/retail-bank-accounts/v1/csv/customers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/csv/customers.csv",
      "bytes": 11396,
      "sha256": "ab89bc3272e9ea4fef05c6baa216410c3aab5442e6fb38fde225d1c609a1da17",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/accounts.csv",
      "format": "csv",
      "table": "accounts",
      "key": "datasets/retail-bank-accounts/v1/csv/accounts.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/csv/accounts.csv",
      "bytes": 10868,
      "sha256": "b33f66238eb7e047db06c536f5d4c5473b389aa352bb2ecbfac44040ed90689c",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/standing_orders.csv",
      "format": "csv",
      "table": "standing_orders",
      "key": "datasets/retail-bank-accounts/v1/csv/standing_orders.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/csv/standing_orders.csv",
      "bytes": 6731,
      "sha256": "d4e3345991d4c7e948014f418c106f8b731f9f85e39781c3cd34e70442e2a047",
      "rows": 150,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/transactions.csv",
      "format": "csv",
      "table": "transactions",
      "key": "datasets/retail-bank-accounts/v1/csv/transactions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/csv/transactions.csv",
      "bytes": 54647,
      "sha256": "a04629df07684b58a2fec2cd81f19733d6d7bf7d6580899901f91b83e441dbc0",
      "rows": 1000,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "retail-bank-accounts.json",
      "format": "json",
      "table": null,
      "key": "datasets/retail-bank-accounts/v1/retail-bank-accounts.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/retail-bank-accounts.json",
      "bytes": 326354,
      "sha256": "c770cf233faa0a76296e3bf3a263e74b6d9e82f9492ab6e3c208113e9fd0f181",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/retail-bank-accounts/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/sql/postgres.sql",
      "bytes": 113381,
      "sha256": "39a2b921e28e11d15b09a2a83ceb44de52dc0069194d92c175da0a62f658823d",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/retail-bank-accounts/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/sql/mysql.sql",
      "bytes": 112707,
      "sha256": "efbbd96ce5702d1b60e6e277bcb222ab1ee57c241f85c00b00f63e0eb16e96cc",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/retail-bank-accounts/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/sql/mssql.sql",
      "bytes": 116889,
      "sha256": "23da39f6c97af1b06848da709d2e1072bac40706df3abfd47d1c29bfef62e4d5",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/retail-bank-accounts/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/sql/sqlite.sql",
      "bytes": 112475,
      "sha256": "a47f2f20ff2f593496f929cfe29199387f152a20c168a57ed81a814d300c5725",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/retail-bank-accounts/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/prisma/seed.ts",
      "bytes": 273143,
      "sha256": "134f47cf5d9e97a456ab2428be7818dd4b4f427375a46f40b05092c53728a51e",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/retail-bank-accounts/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/retail-bank-accounts/v1/django/fixtures.json",
      "bytes": 387088,
      "sha256": "4209a22d16e496eb30c442545c07310e21cefa5e4091f32557a9be3cc4b332ef",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788768778247,
  "updatedAt": 1788768778247
}
