{
  "format": "dataset-manifest/1",
  "slug": "general-ledger",
  "version": 2,
  "seed": "general-ledger:1",
  "spec": {
    "format": "dataset/1",
    "slug": "general-ledger",
    "name": "General Ledger",
    "tagline": "A synthetic general ledger dataset for financial analysis and reporting.",
    "description": "In financial accounting, a general ledger serves as the central repository for all financial transactions, where each entry is categorized into accounts, recorded through journal entries and postings. This dataset contains several interconnected tables that model the structure of a general ledger: accounts, journal entries, postings, and month-end closes. Each table is designed to represent a specific aspect of the ledger, enabling users to explore how transactions affect financial statements and to practice SQL queries and ETL processes. The accounts table outlines the chart of accounts used in the ledger, while the journal entries table captures the details of each transaction. Postings link journal entries to their respective accounts, ensuring that each transaction is appropriately categorized. The month-end closes table marks the end of each accounting period, providing insights into financial performance over time. This synthetic dataset allows developers and analysts to simulate real-world financial scenarios while practicing data manipulation and reporting techniques.",
    "domain": "banking",
    "shape": "ledger",
    "useCases": [
      "sql-practice",
      "etl-pipelines"
    ],
    "keywords": [
      "general ledger",
      "accounts",
      "journal entries",
      "postings",
      "month-end closes",
      "financial data",
      "synthetic data"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "accounts": {
        "description": "This table lists the accounts in the general ledger, each identified by a unique account number. It includes details such as account name and type, linking to transactions recorded in journal entries.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each account."
          },
          "account_number": {
            "kind": "int",
            "min": 1000,
            "max": 9999,
            "unique": true,
            "description": "Unique account number."
          },
          "account_name": {
            "kind": "words",
            "min": 1,
            "max": 3,
            "description": "Name of the account.",
            "nullable": true,
            "when": {
              "column": "account_type",
              "in": [
                "Asset",
                "Liability"
              ]
            },
            "pool": [
              "savings",
              "checking",
              "business",
              "investment",
              "loan",
              "credit",
              "debit",
              "retirement",
              "trust",
              "joint",
              "personal",
              "mortgage",
              "cash",
              "escrow",
              "fund",
              "deposit",
              "overdraft",
              "line",
              "certificate",
              "brokerage",
              "managed",
              "portfolio",
              "wealth",
              "equity",
              "fixed",
              "variable",
              "premium",
              "basic",
              "student",
              "holiday",
              "travel",
              "emergency",
              "health",
              "insurance",
              "pension",
              "tax",
              "charity",
              "gift",
              "inheritance",
              "dividend",
              "revenue",
              "expense",
              "profit",
              "loss",
              "capital",
              "asset",
              "liability",
              "ledger",
              "transaction",
              "balance",
              "statement",
              "audit",
              "report"
            ]
          },
          "account_type": {
            "kind": "enum",
            "values": [
              "Asset",
              "Liability",
              "Equity",
              "Revenue",
              "Expense"
            ],
            "description": "Type of the account."
          }
        }
      },
      "journal_entries": {
        "description": "This table records individual journal entries, detailing each transaction made within the accounting period. Each entry links to an account and includes a date and description.",
        "rows": 300,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each journal entry."
          },
          "account_id": {
            "kind": "fk",
            "ref": "accounts.id",
            "description": "Reference to the account affected by the journal entry."
          },
          "entry_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2023-12-31",
            "description": "Date of the journal entry.",
            "trend": "seasonal"
          },
          "description": {
            "kind": "sentence",
            "max": 100,
            "description": "Description of the transaction.",
            "nullable": true
          },
          "amount": {
            "kind": "decimal",
            "min": 1,
            "max": 10000,
            "scale": 2,
            "description": "Amount of the transaction.",
            "distribution": "long-tail"
          }
        }
      },
      "postings": {
        "description": "This table links journal entries to their respective accounts, indicating how much was debited or credited. Each posting corresponds to a journal entry and specifies whether it is a debit or credit.",
        "rows": 300,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each posting."
          },
          "journal_entry_id": {
            "kind": "fk",
            "ref": "journal_entries.id",
            "description": "Reference to the associated journal entry."
          },
          "debit": {
            "kind": "decimal",
            "min": 0,
            "max": 10000,
            "scale": 2,
            "description": "Debit amount for the account.",
            "distribution": "long-tail"
          },
          "credit": {
            "kind": "decimal",
            "min": 0,
            "max": 10000,
            "scale": 2,
            "description": "Credit amount for the account.",
            "distribution": "long-tail"
          }
        }
      },
      "month_end_closes": {
        "description": "This table records the month-end closes, marking the completion of each accounting period. It links to the journal entries and indicates whether the month-end close is finalized.",
        "rows": 12,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each month-end close."
          },
          "month": {
            "kind": "enum",
            "values": [
              "January",
              "February",
              "March",
              "April",
              "May",
              "June",
              "July",
              "August",
              "September",
              "October",
              "November",
              "December"
            ],
            "description": "Month of the year for the close."
          },
          "close_date": {
            "kind": "date",
            "from": "2023-01-31",
            "to": "2023-12-31",
            "description": "Date of the month-end close.",
            "nullable": true,
            "when": {
              "column": "month",
              "in": [
                "January",
                "February",
                "March"
              ]
            },
            "trend": "growing"
          },
          "is_finalized": {
            "kind": "bool",
            "trueRate": 0.9,
            "description": "Indicates if the month-end close is finalized.",
            "nullable": true
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "timestamped",
      "monetary",
      "categorical"
    ],
    "analysisQuestions": [
      "How many transactions occurred in each month?",
      "What is the total amount debited and credited across all accounts?",
      "Which accounts had the highest number of journal entries?",
      "What is the average transaction amount for each month?",
      "Are there any months where the journal entries do not balance?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Journal Entries and Postings",
        "sql": "SELECT * FROM journal_entries JOIN postings ON journal_entries.id = postings.journal_entry_id;",
        "dialect": "postgres"
      },
      {
        "title": "Total Amounts by Account",
        "sql": "SELECT accounts.account_name, SUM(postings.debit) AS total_debit, SUM(postings.credit) AS total_credit FROM postings JOIN journal_entries ON postings.journal_entry_id = journal_entries.id JOIN accounts ON journal_entries.account_id = accounts.id GROUP BY accounts.account_name;",
        "dialect": "postgres"
      },
      {
        "title": "Monthly Transaction Counts",
        "sql": "SELECT EXTRACT(MONTH FROM entry_date) AS month, COUNT(*) AS transaction_count FROM journal_entries GROUP BY month ORDER BY month;",
        "dialect": "postgres"
      },
      {
        "title": "Average Transaction Amount by Month",
        "sql": "SELECT EXTRACT(MONTH FROM entry_date) AS month, AVG(amount) AS average_amount FROM journal_entries GROUP BY month ORDER BY month;",
        "dialect": "postgres"
      },
      {
        "title": "Unbalanced Journal Entries",
        "sql": "SELECT journal_entries.id FROM journal_entries LEFT JOIN postings ON journal_entries.id = postings.journal_entry_id GROUP BY journal_entries.id HAVING SUM(postings.debit) != SUM(postings.credit);",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Financial Analysts",
        "body": "Financial analysts can utilize this dataset to practice their SQL skills by querying the general ledger for insights into transaction trends, account balances, and month-end closing processes. By manipulating the data, they can understand the flow of financial transactions and the implications of various accounting practices."
      },
      {
        "title": "Data Engineers",
        "body": "Data engineers can leverage this synthetic general ledger dataset to build ETL pipelines that extract, transform, and load financial data into a data warehouse. They can practice creating workflows that ensure data integrity and accuracy, preparing the data for reporting and analysis."
      },
      {
        "title": "Accounting Students",
        "body": "Accounting students can use this dataset to familiarize themselves with the structure of a general ledger, practicing journal entries, postings, and month-end close procedures. This hands-on experience will deepen their understanding of financial accounting concepts and the importance of accurate record-keeping."
      },
      {
        "title": "Business Intelligence Developers",
        "body": "Business intelligence developers can utilize this dataset to create dashboards and visualizations that highlight key financial metrics. By querying the general ledger, they can build reports that provide insights into the financial health of a business, showcasing trends and anomalies in transaction data."
      }
    ]
  },
  "counts": {
    "accounts": 100,
    "journal_entries": 300,
    "month_end_closes": 12,
    "postings": 300
  },
  "stats": {
    "accounts": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "account_number": {
          "nulls": 0,
          "distinct": 100,
          "min": 1167,
          "max": 9992
        },
        "account_name": {
          "nulls": 63,
          "distinct": 37
        },
        "account_type": {
          "nulls": 0,
          "distinct": 5,
          "min": "Asset",
          "max": "Revenue"
        }
      }
    },
    "journal_entries": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "account_id": {
          "nulls": 0,
          "distinct": 97,
          "min": 1,
          "max": 100
        },
        "entry_date": {
          "nulls": 0,
          "distinct": 195,
          "min": "2023-01-01",
          "max": "2023-12-30"
        },
        "description": {
          "nulls": 23,
          "distinct": 277
        },
        "amount": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 9985.77
        }
      }
    },
    "postings": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "journal_entry_id": {
          "nulls": 0,
          "distinct": 199,
          "min": 6,
          "max": 300
        },
        "debit": {
          "nulls": 0,
          "distinct": 300,
          "min": 0.31,
          "max": 9865.85
        },
        "credit": {
          "nulls": 0,
          "distinct": 300,
          "min": 0.43,
          "max": 9973.63
        }
      }
    },
    "month_end_closes": {
      "rows": 12,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 12,
          "min": 1,
          "max": 12
        },
        "month": {
          "nulls": 0,
          "distinct": 7,
          "min": "April",
          "max": "September"
        },
        "close_date": {
          "nulls": 7,
          "distinct": 5,
          "min": "2023-02-11",
          "max": "2023-12-02"
        },
        "is_finalized": {
          "nulls": 1,
          "distinct": 2,
          "min": "false",
          "max": "true"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/accounts.csv",
      "format": "csv",
      "table": "accounts",
      "key": "datasets/general-ledger/v2/csv/accounts.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/csv/accounts.csv",
      "bytes": 2366,
      "sha256": "66a0b63db992bfddcfd47c2b67ea23ea17c220218d61f26ecc839adbd1beb2d3",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/journal_entries.csv",
      "format": "csv",
      "table": "journal_entries",
      "key": "datasets/general-ledger/v2/csv/journal_entries.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/csv/journal_entries.csv",
      "bytes": 23377,
      "sha256": "7539b0072d2d654b107a704fcf71f5d87fcd37651010929c7f4338fbf8006f7c",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/month_end_closes.csv",
      "format": "csv",
      "table": "month_end_closes",
      "key": "datasets/general-ledger/v2/csv/month_end_closes.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/csv/month_end_closes.csv",
      "bytes": 276,
      "sha256": "5de2d122551026369b8787b4ed87ba0fe26932f593873b868a9e69cbcff95632",
      "rows": 12,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/postings.csv",
      "format": "csv",
      "table": "postings",
      "key": "datasets/general-ledger/v2/csv/postings.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/csv/postings.csv",
      "bytes": 7053,
      "sha256": "b7e936a4003beba90abf5d1c23cdc91421fdcc6e55ebeedd2ee73138dc53d32b",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "general-ledger.json",
      "format": "json",
      "table": null,
      "key": "datasets/general-ledger/v2/general-ledger.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/general-ledger.json",
      "bytes": 101827,
      "sha256": "2d1914666d516ee3fc60656b294bf823c847c76b3edf45a9c49d7680f57cd6ce",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/general-ledger/v2/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/sql/postgres.sql",
      "bytes": 43641,
      "sha256": "6c58de6f39de50a08c63963d5d5ba05db3811ac3424300607da08bbc54bcf811",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/general-ledger/v2/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/sql/mysql.sql",
      "bytes": 43145,
      "sha256": "a066d418fb3fdccb4dfb9a6cd478826c4e3684ace0c847d109692e6222604fb7",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/general-ledger/v2/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/sql/mssql.sql",
      "bytes": 44155,
      "sha256": "9137cbb7f3af13015b7a8c707a3fa0d481ec404bd4a9d27fe56e7c97c9f04b81",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/general-ledger/v2/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/sql/sqlite.sql",
      "bytes": 43021,
      "sha256": "fc1865fcbd1218f987a77351b78d414dfe2523f60508e74a1f0ceb784aeb1c9d",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/general-ledger/v2/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/prisma/seed.ts",
      "bytes": 82265,
      "sha256": "c035bc53942f7b5132b2821f80a8145f1d6707cb494c74e87677824c385112fa",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/general-ledger/v2/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/general-ledger/v2/django/fixtures.json",
      "bytes": 134735,
      "sha256": "c6306bec0034e2e7218ce8e1659458b0d46a5733553eb3d68e8a5b66c0c5f13d",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788765876950,
  "updatedAt": 1788778936449
}
