This project is based on an HR dataset stored in a single table (employees
) for analyzing employee-related information.
It provides insights into workforce demographics, salary structures, performance, attrition, and recruitment patterns.
The dataset and queries are designed to:
- Explore employee demographics and job roles.
- Analyze salaries, absences, and performance.
- Calculate attrition rates and employment status.
- Identify workforce distribution across departments, states, and managers.
- Practice SQL concepts such as grouping, filtering, case statements, and aggregate functions.
The repository includes employees.csv which contains the following key attributes:
- Employee Information: Employee ID, Name, DOB, Gender, Marital Status, Age.
- Job Details: Department, Position, Manager Name, Date of Hire, Date of Termination, Employee Status.
- Compensation: Salary, Performance Score, Last Performance Review Date.
- Other Attributes: Recruitment Source, Absences, Termination Reason, State.
-
Employee Metrics:
- Total employees, active vs terminated employees.
- Average salary and average age.
- Average years of service in the company.
- Attrition rate calculation.
-
Demographic Analysis:
- Distribution by gender, age groups, and marital status.
- Workforce count per department, position, and state.
- Manager-wise employee distribution.
-
Compensation Insights:
- Salary ranges and their frequencies.
- Average salaries by department.
- Salary distribution by gender.
-
Performance & Absences:
- Performance score distribution.
- Average absences per performance score.
- Total absences by department.
-
Attrition & Termination Analysis:
- Termination reasons and counts.
- Termination trends by marital status.
-
Recruitment Insights:
- Employee count by recruitment source.
-
Clone the repository:
git clone https://github.com/yourusername/hrdata.git cd hrdata
-
Import the employees.csv dataset into your database (MySQL, PostgreSQL, or SQLite).
-
Create a database named
hrdata
and load the dataset as a table namedemployees
. -
Run SQL queries to analyze HR data and generate insights.
- Calculate attrition rates and track employee turnover.
- Find average salary and compare across departments.
- Identify age and salary ranges of employees.
- Determine which departments have the most absences.
- Analyze recruitment sources and their effectiveness.
- Measure performance scores vs absences trends.
- SQL (MySQL/PostgreSQL/SQLite compatible)
- CSV file for structured data storage
- GitHub for project versioning
- Add visual dashboards for HR analytics (using Tableau, Power BI, or Python libraries).
- Build predictive models for attrition and performance.
- Expand dataset with training, promotions, and benefits information.
- Automate HR reporting using SQL procedures or scripts.
Developed by [Piyush Thool] ✨ This project is created for educational and analytical purposes, focusing on SQL practice with HR datasets.