{
  "format": "dataset-manifest/1",
  "slug": "sample-db-for-sql-server",
  "version": 1,
  "seed": "sample-db-for-sql-server:1",
  "spec": {
    "format": "dataset/1",
    "slug": "sample-db-for-sql-server",
    "name": "Human Resource Management Sample Dataset",
    "tagline": "A synthetic dataset for managing human resources efficiently.",
    "description": "Employees navigate their daily tasks while submitting leave requests, seeking promotions, and addressing support tickets in a vibrant company environment. The efficient management of human resources is crucial as the business strives to optimize employee satisfaction and productivity. Each employee belongs to a designated department, which defines their role and responsibilities within the organization. This interconnected system relies on accurate tracking of leaves, monitoring promotions, and managing support tickets to ensure smooth operations.\n\nIn this dataset, the 'employees' table serves as the core, detailing individual employee records, including their unique identifiers, names, and the departments they belong to. The 'departments' table outlines the various departments within the company, along with relevant attributes such as department names and identifiers. The 'leaves' table captures employee leave requests, linking each request back to the corresponding employee and department, creating relationships that highlight patterns in absenteeism. Lastly, the 'promotions' table tracks advancements in employees' careers, presenting a snapshot of employee progression over time, often reflecting peaks during annual reviews.\n\nThrough this data, developers can practice answering critical questions such as how many leave requests occur per department, which employees are most frequently promoted, and how departments manage support ticket responses during peak leave times. The dataset allows for exploration of trends in employee engagement, departmental performance, and the relationship between leave patterns and promotion rates. It's important to note that this data is synthetic, crafted to provide a realistic yet manageable set of information for honing analytical skills. Dive into this rich dataset and enhance your understanding of human resource management through practical data analysis.",
    "domain": "hr",
    "shape": "star-schema",
    "useCases": [
      "bi-dashboards",
      "analytics-demo"
    ],
    "keywords": [
      "HR management",
      "employee leaves",
      "department tracking",
      "promotions",
      "support tickets",
      "analytics"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "employees": {
        "description": "This table contains information about the employees, including their personal details and department affiliations.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each employee."
          },
          "first_name": {
            "kind": "firstName",
            "description": "Employee's first name."
          },
          "last_name": {
            "kind": "lastName",
            "description": "Employee's last name."
          },
          "email": {
            "kind": "email",
            "from": [
              "first_name",
              "last_name"
            ],
            "description": "Employee's email address."
          },
          "department_id": {
            "kind": "fk",
            "ref": "departments.id",
            "description": "Foreign key linking to the department table."
          },
          "hire_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2024-12-31",
            "description": "Date when the employee was hired.",
            "trend": "growing"
          }
        }
      },
      "departments": {
        "description": "This table lists the departments within the company and their respective managers.",
        "rows": 10,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each department."
          },
          "name": {
            "kind": "words",
            "min": 2,
            "max": 5,
            "description": "Name of the department."
          },
          "manager_id": {
            "kind": "fk",
            "ref": "employees.id",
            "nullable": true,
            "description": "Foreign key linking to the employee who manages the department."
          }
        }
      },
      "leaves": {
        "description": "This table records employee leave requests, including start and end dates.",
        "rows": 500,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each leave request."
          },
          "employee_id": {
            "kind": "fk",
            "ref": "employees.id",
            "description": "Foreign key linking to the employee requesting leave."
          },
          "leave_type": {
            "kind": "enum",
            "values": [
              "sick",
              "vacation",
              "personal"
            ],
            "description": "Type of leave requested."
          },
          "start_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Start date of the leave.",
            "trend": "seasonal"
          },
          "end_date": {
            "kind": "date",
            "after": "start_date",
            "withinDays": 30,
            "description": "End date of the leave, must be after the start date."
          }
        }
      },
      "promotions": {
        "description": "This table tracks employee promotions, detailing when and to what position they were promoted.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each promotion record."
          },
          "employee_id": {
            "kind": "fk",
            "ref": "employees.id",
            "description": "Foreign key linking to the employee who was promoted."
          },
          "new_position": {
            "kind": "words",
            "min": 2,
            "max": 5,
            "description": "The new position after promotion."
          },
          "promotion_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the promotion occurred.",
            "trend": "growing"
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "timestamped",
      "categorical",
      "nullable",
      "high-cardinality"
    ],
    "analysisQuestions": [
      "What is the average duration of employee leaves?",
      "How do promotions correlate with employee performance ratings?",
      "Which departments have the highest leave rates?",
      "What is the distribution of leave types among employees?",
      "How often do employees receive promotions within their departments?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Employees and Leaves",
        "sql": "SELECT e.first_name, e.last_name, l.start_date, l.end_date FROM employees e JOIN leaves l ON e.id = l.employee_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count Leaves by Department",
        "sql": "SELECT d.name, COUNT(l.id) AS leave_count FROM departments d LEFT JOIN employees e ON d.id = e.department_id LEFT JOIN leaves l ON e.id = l.employee_id GROUP BY d.name;",
        "dialect": "postgres"
      },
      {
        "title": "Average Leave Duration",
        "sql": "SELECT employee_id, AVG(end_date - start_date) AS avg_leave_duration FROM leaves GROUP BY employee_id;",
        "dialect": "postgres"
      },
      {
        "title": "Promotions Over Time",
        "sql": "SELECT EXTRACT(YEAR FROM promotion_date) AS year, COUNT(id) AS promotions_count FROM promotions GROUP BY year ORDER BY year;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "HR Analytics Dashboard",
        "body": "HR analysts can utilize this dataset to build dashboards that visualize employee leave patterns, track department performance, and analyze promotion trends. By integrating this data into BI tools, they can derive insights that help in strategic planning and resource allocation."
      },
      {
        "title": "Employee Leave Management",
        "body": "HR managers can use this dataset to monitor and manage employee leave requests effectively. By analyzing the leave data, they can identify peak leave periods and ensure that staffing levels are maintained throughout the year."
      },
      {
        "title": "Support Ticket Analysis",
        "body": "Support team leaders can leverage the dataset to analyze the performance of teams in resolving support tickets. By correlating support ticket resolutions with employee performances and promotions, they can identify training needs and improve service quality."
      },
      {
        "title": "Promotional Insights",
        "body": "Business analysts can explore the promotions table to understand the timing and frequency of promotions across different departments. This analysis can help identify best practices and inform future promotional strategies."
      }
    ]
  },
  "counts": {
    "departments": 10,
    "employees": 200,
    "leaves": 500,
    "promotions": 100
  },
  "stats": {
    "employees": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "first_name": {
          "nulls": 0,
          "distinct": 72,
          "min": "Alice",
          "max": "Zoe"
        },
        "last_name": {
          "nulls": 0,
          "distinct": 71,
          "min": "Adams",
          "max": "Zhang"
        },
        "email": {
          "nulls": 0,
          "distinct": 200
        },
        "department_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "hire_date": {
          "nulls": 0,
          "distinct": 188,
          "min": "2020-01-03",
          "max": "2024-12-26"
        }
      }
    },
    "departments": {
      "rows": 10,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "name": {
          "nulls": 0,
          "distinct": 10
        },
        "manager_id": {
          "nulls": 2,
          "distinct": 8,
          "min": 10,
          "max": 138
        }
      }
    },
    "leaves": {
      "rows": 500,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 500,
          "min": 1,
          "max": 500
        },
        "employee_id": {
          "nulls": 0,
          "distinct": 181,
          "min": 2,
          "max": 200
        },
        "leave_type": {
          "nulls": 0,
          "distinct": 3,
          "min": "personal",
          "max": "vacation"
        },
        "start_date": {
          "nulls": 0,
          "distinct": 340,
          "min": "2023-01-01",
          "max": "2024-12-29"
        },
        "end_date": {
          "nulls": 0,
          "distinct": 336,
          "min": "2023-01-11",
          "max": "2025-01-20"
        }
      }
    },
    "promotions": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "employee_id": {
          "nulls": 0,
          "distinct": 81,
          "min": 1,
          "max": 200
        },
        "new_position": {
          "nulls": 0,
          "distinct": 100
        },
        "promotion_date": {
          "nulls": 0,
          "distinct": 90,
          "min": "2023-01-09",
          "max": "2024-12-28"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/departments.csv",
      "format": "csv",
      "table": "departments",
      "key": "datasets/sample-db-for-sql-server/v1/csv/departments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/csv/departments.csv",
      "bytes": 378,
      "sha256": "2ce9ed0661668d5ad83c7dadbe1b1b0bca94c2379970474a4b359041bbc5d3b8",
      "rows": 10,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/employees.csv",
      "format": "csv",
      "table": "employees",
      "key": "datasets/sample-db-for-sql-server/v1/csv/employees.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/csv/employees.csv",
      "bytes": 10735,
      "sha256": "4acb8d1f3c8e728b6cc1b3232aec3f4d043d5a0fb8597784eb6d435b701340cb",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/leaves.csv",
      "format": "csv",
      "table": "leaves",
      "key": "datasets/sample-db-for-sql-server/v1/csv/leaves.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/csv/leaves.csv",
      "bytes": 19068,
      "sha256": "58dd482eef51bba1abed6aad808c500da6f9780267e1c5ae4114e33b005657e8",
      "rows": 500,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/promotions.csv",
      "format": "csv",
      "table": "promotions",
      "key": "datasets/sample-db-for-sql-server/v1/csv/promotions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/csv/promotions.csv",
      "bytes": 4154,
      "sha256": "fdd1cc50de16c959e2b34cb65d85d7d7bb5222306428fdd38816bc805588e11b",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "sample-db-for-sql-server.json",
      "format": "json",
      "table": null,
      "key": "datasets/sample-db-for-sql-server/v1/sample-db-for-sql-server.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/sample-db-for-sql-server.json",
      "bytes": 127784,
      "sha256": "76569dd408c66d40bae60df0705c42c133d690afbcc49a0e0716df81773cff19",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/sample-db-for-sql-server/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/sql/postgres.sql",
      "bytes": 49970,
      "sha256": "8bf1fbac606160927ff7a59f82d90fb041829058eac05445d2070e1807999e61",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/sample-db-for-sql-server/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/sql/mysql.sql",
      "bytes": 49523,
      "sha256": "cc692d585cf7367dd1a922f62ad1246c7d732668545042931d990d67bbe2cb39",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/sample-db-for-sql-server/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/sql/mssql.sql",
      "bytes": 52291,
      "sha256": "8e8ec6c031f69c66150a991ae1999fb8a36c40e4121d6d3610a902238607c508",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/sample-db-for-sql-server/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/sql/sqlite.sql",
      "bytes": 49332,
      "sha256": "95093fd92b052fa230494c17c8ea1054166f817abdd473a1070fcba51cfdfed0",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/sample-db-for-sql-server/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/prisma/seed.ts",
      "bytes": 98882,
      "sha256": "960380011fd91d4ecc1bfef14982ea6d3a7944db3e0d436b882ccc29e779d4d9",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/sample-db-for-sql-server/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sample-db-for-sql-server/v1/django/fixtures.json",
      "bytes": 160340,
      "sha256": "89607513bc31bbec0f3b77b5d90699278177c2c90000cef15f6a36ed22419ec2",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788768493070,
  "updatedAt": 1788768493070
}
