{
  "format": "dataset-manifest/1",
  "slug": "org-chart",
  "version": 2,
  "seed": "org-chart:1",
  "spec": {
    "format": "dataset/1",
    "slug": "org-chart",
    "name": "Organization Chart",
    "tagline": "A synthetic dataset modeling an organizational hierarchy.",
    "description": "Employees report to their managers in a structured hierarchy, defining the operational flow within an organization. Each employee is associated with a specific department that delineates their functional area, while their job title outlines their role and responsibilities. Understanding these relationships is crucial for managing the workforce effectively and facilitating communication across different levels of the organization. \n\nIn this dataset, the 'employees' table contains individual records for each staff member, including details such as their name, unique ID, and their manager's ID, which links to another employee. The 'departments' table categorizes these employees based on the department they belong to, providing a clear view of which employees are grouped together. The 'job_titles' table holds roles assigned to employees, indicating their expected contributions to the organization's objectives. \n\nBy joining the 'employees' table with 'departments', you can analyze the workforce distribution across various divisions. Similarly, linking 'employees' with 'job_titles' allows for insights into how roles are allocated within that structure. This dataset is particularly useful for practicing recursive queries, as it involves navigating the relationships of employees to their managers, and can help answer questions like who reports to whom, the hierarchy of job titles, and the distribution of employees across departments. \n\nThe data available here is synthetic, created to provide a realistic environment for developers and analysts to hone their skills in working with organizational structures and hierarchies.",
    "domain": "hr",
    "shape": "hierarchical",
    "useCases": [
      "teaching",
      "api-mocking"
    ],
    "keywords": [
      "organization",
      "employees",
      "departments",
      "job titles",
      "hierarchy",
      "synthetic"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "employees": {
        "description": "This table contains records of employees, each linked to their job title and department. Employees can report to other employees, creating a hierarchical structure.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each employee."
          },
          "full_name": {
            "kind": "fullName",
            "description": "The full name of the employee."
          },
          "job_title_id": {
            "kind": "fk",
            "ref": "job_titles.id",
            "description": "The job title of the employee."
          },
          "department_id": {
            "kind": "fk",
            "ref": "departments.id",
            "description": "The department the employee belongs to."
          },
          "manager_id": {
            "kind": "fk",
            "ref": "employees.id",
            "nullable": true,
            "description": "The employee's manager, if applicable."
          }
        }
      },
      "departments": {
        "description": "This table lists various departments within the organization, each linked to a specific job title structure and containing multiple employees.",
        "rows": 20,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each department."
          },
          "name": {
            "kind": "words",
            "max": 3,
            "description": "The name of the department.",
            "pool": [
              "human",
              "resources",
              "finance",
              "marketing",
              "sales",
              "engineering",
              "operations",
              "it",
              "legal",
              "compliance",
              "customer",
              "support",
              "product",
              "development",
              "research",
              "analytics",
              "strategy",
              "design",
              "training",
              "administration",
              "project"
            ],
            "min": 1
          },
          "job_title_id": {
            "kind": "fk",
            "ref": "job_titles.id",
            "description": "The job title associated with the department."
          }
        }
      },
      "job_titles": {
        "description": "This table contains various job titles available within the organization, linking them to specific departments.",
        "rows": 30,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each job title."
          },
          "title": {
            "kind": "words",
            "max": 3,
            "description": "The name of the job title.",
            "pool": [
              "manager",
              "director",
              "coordinator",
              "analyst",
              "specialist",
              "engineer",
              "developer",
              "consultant",
              "assistant",
              "executive",
              "officer",
              "administrator",
              "representative",
              "lead",
              "associate",
              "strategist",
              "designer",
              "researcher",
              "trainer",
              "technician",
              "supervisor"
            ],
            "min": 1
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "nullable",
      "high-cardinality",
      "self-referencing"
    ],
    "analysisQuestions": [
      "Who are the top-level managers in the organization?",
      "How many employees are in each department?",
      "What job titles are most common among employees?",
      "Which employees report to a specific manager?",
      "What is the average number of employees per department?"
    ],
    "suggestedQueries": [
      {
        "title": "List all employees and their job titles",
        "sql": "SELECT e.full_name, jt.title FROM employees e JOIN job_titles jt ON e.job_title_id = jt.id",
        "dialect": "postgres"
      },
      {
        "title": "Count employees in each department",
        "sql": "SELECT d.name, COUNT(e.id) as employee_count FROM departments d LEFT JOIN employees e ON d.id = e.department_id GROUP BY d.name",
        "dialect": "postgres"
      },
      {
        "title": "Find all employees reporting to a specific manager",
        "sql": "SELECT e.full_name FROM employees e WHERE e.manager_id = $1",
        "dialect": "postgres"
      },
      {
        "title": "List departments with their associated job titles",
        "sql": "SELECT d.name, jt.title FROM departments d JOIN job_titles jt ON d.job_title_id = jt.id",
        "dialect": "postgres"
      },
      {
        "title": "Get the hierarchy of employees under a specific manager",
        "sql": "WITH RECURSIVE employee_hierarchy AS (SELECT e.id, e.full_name, e.manager_id FROM employees e WHERE e.manager_id = $1 UNION ALL SELECT e.id, e.full_name, e.manager_id FROM employees e JOIN employee_hierarchy eh ON e.manager_id = eh.id) SELECT * FROM employee_hierarchy",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "HR Management Training",
        "body": "HR professionals can use this dataset to train on organizational structure management. By querying the hierarchical relationships, they can learn how to visualize and manage employee reporting structures effectively."
      },
      {
        "title": "API Development for Employee Directory",
        "body": "Developers building an employee directory API can utilize this dataset to mock the data structure and relationships. It helps in testing the endpoints that retrieve employee details, department listings, and hierarchical reporting."
      },
      {
        "title": "Organizational Analysis",
        "body": "Analysts can leverage this dataset to perform organizational analysis, identifying trends like departmental distribution of job titles and the number of employees reporting to each manager. This can inform strategic decisions regarding staffing and resource allocation."
      }
    ]
  },
  "counts": {
    "job_titles": 30,
    "departments": 20,
    "employees": 100
  },
  "stats": {
    "employees": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "full_name": {
          "nulls": 0,
          "distinct": 99,
          "min": "Amir Lopez",
          "max": "Zoe Murphy"
        },
        "job_title_id": {
          "nulls": 0,
          "distinct": 29,
          "min": 1,
          "max": 29
        },
        "department_id": {
          "nulls": 0,
          "distinct": 19,
          "min": 1,
          "max": 20
        },
        "manager_id": {
          "nulls": 14,
          "distinct": 45,
          "min": 1,
          "max": 76
        }
      }
    },
    "departments": {
      "rows": 20,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 20,
          "min": 1,
          "max": 20
        },
        "name": {
          "nulls": 0,
          "distinct": 18
        },
        "job_title_id": {
          "nulls": 0,
          "distinct": 14,
          "min": 1,
          "max": 29
        }
      }
    },
    "job_titles": {
      "rows": 30,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 30,
          "min": 1,
          "max": 30
        },
        "title": {
          "nulls": 0,
          "distinct": 27
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/job_titles.csv",
      "format": "csv",
      "table": "job_titles",
      "key": "datasets/org-chart/v2/csv/job_titles.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/csv/job_titles.csv",
      "bytes": 746,
      "sha256": "80f3622e49124c2188b6141d68332c4089eb020c3514de8a622bc171e909064c",
      "rows": 30,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/departments.csv",
      "format": "csv",
      "table": "departments",
      "key": "datasets/org-chart/v2/csv/departments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/csv/departments.csv",
      "bytes": 454,
      "sha256": "aab06cb59af3f8112f3ced0c0d56ee5b0aaa69913f86f9b802676bc824cb3d96",
      "rows": 20,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/employees.csv",
      "format": "csv",
      "table": "employees",
      "key": "datasets/org-chart/v2/csv/employees.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/csv/employees.csv",
      "bytes": 2430,
      "sha256": "1ef05e42a71b539623fb9261534c0991ff234144192bd3eb29eb187c5bd1dc87",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "org-chart.json",
      "format": "json",
      "table": null,
      "key": "datasets/org-chart/v2/org-chart.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/org-chart.json",
      "bytes": 17611,
      "sha256": "9da715aab1742cb97dc85283936a55a1db0202a499dbedef8ede63783603cdd6",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/org-chart/v2/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/sql/postgres.sql",
      "bytes": 7082,
      "sha256": "cab8da1f6d9967f89d08fac2ae21f094f658678e3a2f86f95d81819e436eedde",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/org-chart/v2/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/sql/mysql.sql",
      "bytes": 6739,
      "sha256": "c00ff0803eed5cbab12d2115e044ba6dc49ebeeba1f91ae78a63969d2d2002c9",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/org-chart/v2/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/sql/mssql.sql",
      "bytes": 7087,
      "sha256": "27a4bad34bbfed56bc7fd8f6712293db118b88027bb2584888f9cf40b1c1453e",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/org-chart/v2/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/sql/sqlite.sql",
      "bytes": 6568,
      "sha256": "a973ba28f49a7eb83f96652e421d0d67457b63c50a5288214070ac8e62b048b3",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/org-chart/v2/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/prisma/seed.ts",
      "bytes": 14057,
      "sha256": "973a55e41c5b6e439fa478418f16bea02bb236cf1b0068a56c79df507caae46f",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/org-chart/v2/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/org-chart/v2/django/fixtures.json",
      "bytes": 23375,
      "sha256": "fdb04aa575212010ba378d48d8169c91845541340112f7c0cf64bbb81062145c",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788767421675,
  "updatedAt": 1788785260261
}
