{
  "format": "dataset-manifest/1",
  "slug": "hr-ledger-insights",
  "version": 3,
  "seed": "hr-ledger-insights:1",
  "engine": 1,
  "engineVersion": "1.0.0",
  "spec": {
    "format": "dataset/1",
    "slug": "hr-ledger-insights",
    "name": "HR Ledger Insights",
    "tagline": "Employee payroll applications, purchase and sales orders, and journal entries within an HR financial environment.",
    "description": "Employees manage their tasks and contribute to the overall success of the organization, while the financial side ensures their compensation and departmental needs are systematically addressed. Payroll applications are submitted consistently to reflect the regular salary payments for the staff, occurring on a monthly or bi-weekly basis. These applications are linked to the employees through unique identifiers, allowing for accurate tracking of payroll data and ensuring that every employee receives their rightful compensation.\n\nAlongside payroll, the organization tracks expenditures through purchase orders and sales orders, which serve as requests for goods or services. Purchase orders are issued less frequently and often have varied amounts depending on the operational requirements of different departments. Each purchase order links back to specific departments, embedding an essential relationship between financial spending and departmental function. This structure allows for a clear overview of how funds are being allocated across different areas within the organization.\n\nJournal entries capture the financial transactions that occur as a result of payroll applications and purchase/sales orders. Each journal entry is associated with a specific transaction type, providing a comprehensive view of the financial health of the business and ensuring that all financial activities are properly recorded. The relationship between journal entries, payroll applications, and purchase orders allows users to analyze trends in employee compensation and departmental spending, making it possible to identify patterns, anomalies, and areas requiring attention.\n\nThe data can answer key questions about the organization's financial operations: How much is spent on employee salaries versus departmental purchases? What are the peaks in spending, and what causes them? How do various departments contribute to overall financial performance? Practicing with this dataset can enhance skills in financial analysis, reporting, and data handling within a human resources context. Please note that the data is synthetic, designed to mimic realistic scenarios while ensuring confidentiality.",
    "domain": "hr",
    "shape": "ledger",
    "useCases": [
      "sql-practice",
      "teaching"
    ],
    "keywords": [
      "HR",
      "ledger",
      "financial transactions",
      "payroll",
      "expenditure",
      "journal entries",
      "purchase orders",
      "sales orders"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "employees": {
        "description": "This table holds records of employees, including their personal and compensation details. Each employee can have multiple payroll records linked through their employee_id.",
        "rows": 200,
        "columns": {
          "employee_id": {
            "kind": "pk",
            "description": "Unique identifier for each employee."
          },
          "full_name": {
            "kind": "fullName",
            "description": "The full name of the employee."
          },
          "department": {
            "kind": "enum",
            "values": [
              "HR",
              "Sales",
              "Marketing",
              "Finance",
              "IT"
            ],
            "description": "The department where the employee works.",
            "weights": [
              5,
              3,
              2,
              1,
              1
            ]
          },
          "salary": {
            "kind": "decimal",
            "min": 30000,
            "max": 150000,
            "scale": 2,
            "description": "The annual salary of the employee.",
            "distribution": "heavy-tail"
          }
        }
      },
      "payroll_applications": {
        "description": "This table tracks payroll applications for each employee, detailing payment dates and amounts. It links to employees through employee_id.",
        "rows": 600,
        "columns": {
          "application_id": {
            "kind": "pk",
            "description": "Unique identifier for each payroll application."
          },
          "employee_id": {
            "kind": "fk",
            "ref": "employees.employee_id",
            "description": "References the employee to whom the payroll application belongs."
          },
          "payment_date": {
            "kind": "date",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date of the payroll payment.",
            "trend": "growing"
          },
          "amount": {
            "kind": "decimal",
            "min": 1500,
            "max": 12500,
            "scale": 2,
            "description": "The amount paid in this payroll application.",
            "distribution": "long-tail"
          },
          "payment_method": {
            "kind": "enum",
            "values": [
              "bank transfer",
              "check",
              "cash"
            ],
            "weights": [
              70,
              20,
              10
            ],
            "description": "Method used for payroll payment."
          },
          "status": {
            "kind": "enum",
            "values": [
              "processed",
              "pending",
              "failed"
            ],
            "weights": [
              80,
              15,
              5
            ],
            "description": "Current status of the payroll application."
          }
        }
      },
      "purchase_orders": {
        "description": "This table contains records of purchase orders made by various departments for goods and services. Each purchase order can have multiple journal entries linked through purchase_order_id.",
        "rows": 150,
        "columns": {
          "purchase_order_id": {
            "kind": "pk",
            "description": "Unique identifier for each purchase order."
          },
          "department": {
            "kind": "enum",
            "values": [
              "HR",
              "Sales",
              "Marketing",
              "Finance",
              "IT"
            ],
            "description": "The department that issued the purchase order.",
            "weights": [
              4,
              3,
              2,
              2,
              1
            ]
          },
          "order_date": {
            "kind": "date",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date the purchase order was created.",
            "trend": "seasonal"
          },
          "total_amount": {
            "kind": "decimal",
            "min": 100,
            "max": 50000,
            "scale": 2,
            "description": "Total amount for the purchase order.",
            "distribution": "long-tail"
          }
        }
      },
      "sales_orders": {
        "description": "This table tracks sales orders generated by the sales department, reflecting revenue transactions. Each sales order links to purchase orders for related expenses.",
        "rows": 200,
        "columns": {
          "sales_order_id": {
            "kind": "pk",
            "description": "Unique identifier for each sales order."
          },
          "purchase_order_id": {
            "kind": "fk",
            "ref": "purchase_orders.purchase_order_id",
            "nullable": true,
            "description": "References the associated purchase order."
          },
          "order_date": {
            "kind": "date",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date the sales order was created.",
            "trend": "growing"
          },
          "sales_amount": {
            "kind": "decimal",
            "min": 500,
            "max": 100000,
            "scale": 2,
            "description": "Total sales amount for this order.",
            "distribution": "long-tail"
          },
          "payment_status": {
            "kind": "enum",
            "values": [
              "paid",
              "unpaid",
              "refunded"
            ],
            "weights": [
              75,
              20,
              5
            ],
            "description": "Payment status of the sales order."
          }
        }
      },
      "journal_entries": {
        "description": "This table records journal entries for both payroll and purchase transactions, linking them to their respective applications or orders.",
        "rows": 800,
        "columns": {
          "entry_id": {
            "kind": "pk",
            "description": "Unique identifier for each journal entry."
          },
          "application_id": {
            "kind": "fk",
            "ref": "payroll_applications.application_id",
            "nullable": true,
            "description": "References the payroll application if applicable."
          },
          "purchase_order_id": {
            "kind": "fk",
            "ref": "purchase_orders.purchase_order_id",
            "nullable": true,
            "description": "References the purchase order if applicable."
          },
          "entry_date": {
            "kind": "date",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "Date of the journal entry."
          },
          "amount": {
            "kind": "decimal",
            "min": 0,
            "max": 100000,
            "scale": 2,
            "description": "Transaction amount recorded in the journal entry.",
            "distribution": "long-tail"
          },
          "entry_type": {
            "kind": "enum",
            "values": [
              "payroll",
              "purchase"
            ],
            "description": "Type of transaction recorded in the journal entry."
          },
          "reference_number": {
            "kind": "pattern",
            "pattern": "JE-#####",
            "description": "Unique reference number for the journal entry."
          }
        }
      },
      "departments": {
        "description": "This table contains a list of departments in the organization, providing details on department-specific budgets and expenditures.",
        "rows": 5,
        "columns": {
          "department_name": {
            "kind": "pk",
            "description": "Unique name of the department."
          },
          "budget": {
            "kind": "decimal",
            "min": 100000,
            "max": 1000000,
            "scale": 2,
            "description": "Annual budget allocated to the department.",
            "distribution": "long-tail"
          },
          "total_expenditure": {
            "kind": "decimal",
            "min": 0,
            "max": 1000000,
            "scale": 2,
            "description": "Total funds spent by the department.",
            "distribution": "long-tail"
          },
          "head": {
            "kind": "fullName",
            "description": "Full name of the department head."
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "monetary",
      "timestamped",
      "nullable"
    ],
    "analysisQuestions": [
      "What is the average salary across different departments?",
      "How do purchase orders fluctuate over the fiscal year?",
      "What percentage of the budget is spent on payroll versus other expenditures?",
      "Are there any noticeable spikes in spending during recruitment periods?",
      "How do sales orders impact the overall financial health of the departments?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Payroll Applications with Employees",
        "sql": "SELECT e.full_name, p.payment_date, p.amount FROM payroll_applications p JOIN employees e ON p.employee_id = e.employee_id;",
        "dialect": "postgres"
      },
      {
        "title": "Aggregate Total Salary by Department",
        "sql": "SELECT department, SUM(salary) as total_salary FROM employees GROUP BY department;",
        "dialect": "postgres"
      },
      {
        "title": "Monthly Purchase Order Totals",
        "sql": "SELECT DATE_TRUNC('month', order_date) as month, SUM(total_amount) as total_orders FROM purchase_orders GROUP BY month ORDER BY month;",
        "dialect": "postgres"
      },
      {
        "title": "Journal Entries Linked to Payroll Applications",
        "sql": "SELECT j.entry_date, j.amount, e.full_name FROM journal_entries j JOIN payroll_applications p ON j.application_id = p.application_id JOIN employees e ON p.employee_id = e.employee_id WHERE j.application_id IS NOT NULL;",
        "dialect": "postgres"
      },
      {
        "title": "Departmental Budget Utilization",
        "sql": "SELECT d.department_name, d.budget, SUM(j.amount) as total_expenditure FROM departments d LEFT JOIN journal_entries j ON d.department_name = j.department GROUP BY d.department_name, d.budget;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Teaching Financial Analysis",
        "body": "Instructors can leverage this dataset to teach students about financial analysis in an HR context. By using real-world scenarios reflected in the data, students can learn how to analyze payroll trends, departmental spending, and financial reporting."
      },
      {
        "title": "Practice SQL Queries for HR Transactions",
        "body": "Developers and data analysts can use this dataset to practice SQL queries related to HR financial transactions. Whether they are beginners or advanced users, there are plenty of opportunities to explore joins, aggregations, and date functions in their queries."
      },
      {
        "title": "Budget Management and Forecasting",
        "body": "HR managers can use the insights gained from this dataset to manage their departmental budgets more effectively. By analyzing spending patterns, they can forecast future expenditures and make informed decisions regarding resource allocation and hiring."
      },
      {
        "title": "Evaluating Compensation Strategies",
        "body": "Compensation specialists can utilize this dataset to evaluate the effectiveness of various compensation strategies within the organization. By comparing salary data across departments, they can identify trends and areas for improvement in employee compensation."
      }
    ]
  },
  "counts": {
    "departments": 5,
    "employees": 200,
    "payroll_applications": 600,
    "purchase_orders": 150,
    "journal_entries": 800,
    "sales_orders": 200
  },
  "stats": {
    "employees": {
      "rows": 200,
      "columns": {
        "employee_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "full_name": {
          "nulls": 0,
          "distinct": 198,
          "min": "Alice Torres",
          "max": "Zoe Walker"
        },
        "department": {
          "nulls": 0,
          "distinct": 5,
          "min": "Finance",
          "max": "Sales"
        },
        "salary": {
          "nulls": 0,
          "distinct": 199,
          "min": 30000,
          "max": 147845.92
        }
      }
    },
    "payroll_applications": {
      "rows": 600,
      "columns": {
        "application_id": {
          "nulls": 0,
          "distinct": 600,
          "min": 1,
          "max": 600
        },
        "employee_id": {
          "nulls": 0,
          "distinct": 187,
          "min": 1,
          "max": 200
        },
        "payment_date": {
          "nulls": 0,
          "distinct": 381,
          "min": "2022-01-01",
          "max": "2023-12-31"
        },
        "amount": {
          "nulls": 0,
          "distinct": 600,
          "min": 1500,
          "max": 12470.39
        },
        "payment_method": {
          "nulls": 0,
          "distinct": 3,
          "min": "bank transfer",
          "max": "check"
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "failed",
          "max": "processed"
        }
      }
    },
    "purchase_orders": {
      "rows": 150,
      "columns": {
        "purchase_order_id": {
          "nulls": 0,
          "distinct": 150,
          "min": 1,
          "max": 150
        },
        "department": {
          "nulls": 0,
          "distinct": 5,
          "min": "Finance",
          "max": "Sales"
        },
        "order_date": {
          "nulls": 0,
          "distinct": 139,
          "min": "2022-01-10",
          "max": "2023-12-31"
        },
        "total_amount": {
          "nulls": 0,
          "distinct": 150,
          "min": 119.88,
          "max": 49526.67
        }
      }
    },
    "sales_orders": {
      "rows": 200,
      "columns": {
        "sales_order_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "purchase_order_id": {
          "nulls": 16,
          "distinct": 108,
          "min": 1,
          "max": 150
        },
        "order_date": {
          "nulls": 0,
          "distinct": 179,
          "min": "2022-01-13",
          "max": "2023-12-27"
        },
        "sales_amount": {
          "nulls": 0,
          "distinct": 200,
          "min": 503.6,
          "max": 99874.39
        },
        "payment_status": {
          "nulls": 0,
          "distinct": 3,
          "min": "paid",
          "max": "unpaid"
        }
      }
    },
    "journal_entries": {
      "rows": 800,
      "columns": {
        "entry_id": {
          "nulls": 0,
          "distinct": 800,
          "min": 1,
          "max": 800
        },
        "application_id": {
          "nulls": 81,
          "distinct": 415,
          "min": 1,
          "max": 600
        },
        "purchase_order_id": {
          "nulls": 77,
          "distinct": 150,
          "min": 1,
          "max": 150
        },
        "entry_date": {
          "nulls": 0,
          "distinct": 473,
          "min": "2022-01-01",
          "max": "2023-12-30"
        },
        "amount": {
          "nulls": 0,
          "distinct": 799,
          "min": 0.04,
          "max": 99607.69
        },
        "entry_type": {
          "nulls": 0,
          "distinct": 2,
          "min": "payroll",
          "max": "purchase"
        },
        "reference_number": {
          "nulls": 0,
          "distinct": 795
        }
      }
    },
    "departments": {
      "rows": 5,
      "columns": {
        "department_name": {
          "nulls": 0,
          "distinct": 5,
          "min": 1,
          "max": 5
        },
        "budget": {
          "nulls": 0,
          "distinct": 5,
          "min": 102653.22,
          "max": 771807.58
        },
        "total_expenditure": {
          "nulls": 0,
          "distinct": 5,
          "min": 19796.22,
          "max": 508404.84
        },
        "head": {
          "nulls": 0,
          "distinct": 5,
          "min": "Chen Jansen",
          "max": "Zara Gupta"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/departments.csv",
      "format": "csv",
      "table": "departments",
      "key": "datasets/hr-ledger-insights/v3/csv/departments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/csv/departments.csv",
      "bytes": 216,
      "sha256": "aea0aa9e67b877598cc9e27d471e9bd06f8cba8c090202d532e65cb7f5a2ad62",
      "rows": 5,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/employees.csv",
      "format": "csv",
      "table": "employees",
      "key": "datasets/hr-ledger-insights/v3/csv/employees.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/csv/employees.csv",
      "bytes": 6267,
      "sha256": "c63b3c6630ef8697f4fe4f3fb192882f2e59bb9ae98fd97368073427af10cf49",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/payroll_applications.csv",
      "format": "csv",
      "table": "payroll_applications",
      "key": "datasets/hr-ledger-insights/v3/csv/payroll_applications.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/csv/payroll_applications.csv",
      "bytes": 29143,
      "sha256": "724e1641ac748f2eb85d5243160dd9c0007b811a0e528cb2870d5bcf11d3c857",
      "rows": 600,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/purchase_orders.csv",
      "format": "csv",
      "table": "purchase_orders",
      "key": "datasets/hr-ledger-insights/v3/csv/purchase_orders.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/csv/purchase_orders.csv",
      "bytes": 4505,
      "sha256": "402eab27b367f0aadfe1938d785fe323b08140dc50510f5d3a6b641c218875f9",
      "rows": 150,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/journal_entries.csv",
      "format": "csv",
      "table": "journal_entries",
      "key": "datasets/hr-ledger-insights/v3/csv/journal_entries.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/csv/journal_entries.csv",
      "bytes": 38897,
      "sha256": "34eef6edc1a86f99bd4e85f17fea0a990114bf2482761f15c6937fdccabdbab7",
      "rows": 800,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/sales_orders.csv",
      "format": "csv",
      "table": "sales_orders",
      "key": "datasets/hr-ledger-insights/v3/csv/sales_orders.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/csv/sales_orders.csv",
      "bytes": 6641,
      "sha256": "63d44f21158a27619b78a1416a3b3276335c8fdc37664388b1794d55665dd184",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "hr-ledger-insights.json",
      "format": "json",
      "table": null,
      "key": "datasets/hr-ledger-insights/v3/hr-ledger-insights.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/hr-ledger-insights.json",
      "bytes": 376632,
      "sha256": "bb957ea052b8727571b371d3bde19af3b718b74588497d1a002e3d2326c0b616",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/hr-ledger-insights/v3/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/sql/postgres.sql",
      "bytes": 122634,
      "sha256": "6dea2580cbb1583b0c059a69b629a2bab6ff02800db743c87fb2af38d76df56b",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/hr-ledger-insights/v3/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/sql/mysql.sql",
      "bytes": 121777,
      "sha256": "019d03ed5b83d1cd6b25fe1b9e40f75f9cd4a1d700b1333cc50ac0646bc5cb85",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/hr-ledger-insights/v3/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/sql/mssql.sql",
      "bytes": 127525,
      "sha256": "d5b63577dfdef637b13c7412619ad0700dae8ef7c4cfe45e0111f7c0e8f76230",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/hr-ledger-insights/v3/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/sql/sqlite.sql",
      "bytes": 121491,
      "sha256": "6f7824fcf16e26e4e3365c1cd5080c6660aea963ea7333d6e0a132c6cbd211ab",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/hr-ledger-insights/v3/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/prisma/seed.ts",
      "bytes": 296768,
      "sha256": "fe35043c0df49d60dca0d8d3d5c71797d1b902462c5dfa1cbdfd6fdaf4a49aa6",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/hr-ledger-insights/v3/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/hr-ledger-insights/v3/django/fixtures.json",
      "bytes": 453229,
      "sha256": "0384084bf05080ff5139ee90e1c5fcb888cb61b57712210674130352112ba458",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788767436801,
  "updatedAt": 1789095862621
}
