Tool: MySQL | Domain: Human Resources | Dataset: HRDataset_v14 (Kaggle)
A complete SQL-based HR analysis project exploring workforce trends, attrition patterns, salary distribution, recruitment effectiveness, and absenteeism across departments using 12 business-driven queries.
HR teams struggle to identify which departments have high attrition, where salary inequities exist, and which recruitment sources bring the best employees. This project answers 12 critical HR business questions using pure SQL.
| # | Insight |
|---|---|
| 1 | Production is the largest department with 201 employees |
| 2 | Production has highest attrition at 41.29% — needs urgent retention strategy |
| 3 | President & CEO earns $250,000 — highest salary in the company |
| 4 | Admin Offices is most gender-balanced at 66.7% female |
| 5 | IT/IS dominates top 10 highest paid employees |
| 6 | IT/IS has 42 employees with "Fully Meets" performance score |
| 7 | Website hiring has lowest attrition at 7.7% — best source |
| 8 | Male employees earn $70,879 avg vs Female $68,067 — pay gap exists |
| 9 | Sales has highest absenteeism at 11.5 days average |
| 10 | Single employees earn slightly more ($70,465) than married ($70,077) |
| Tool | Usage |
|---|---|
| MySQL | Database creation & query execution |
| MySQL Workbench | SQL IDE and result visualization |
| SQL | Data analysis and business insights |
| Query | Business Question |
|---|---|
| Q1 | Total employees by department |
| Q2 | Attrition rate by department |
| Q3 | Average salary by position (Top 10) |
| Q4 | Gender distribution across departments |
| Q5 | Top 10 highest paid employees |
| Q6 | Employees by age group |
| Q7 | Performance score by department |
| Q8 | Recruitment source effectiveness |
| Q9 | Gender pay gap analysis |
| Q10 | Yearly hiring trend |
| Q11 | Absenteeism by department |
| Q12 | Salary by marital status |
| File | Description |
|---|---|
hr_analytics.sql |
All 12 SQL queries with comments |
q1_departments.png |
Query 1 result screenshot |
q2_attrition.png |
Query 2 result screenshot |
q3_salary.png |
Query 3 result screenshot |
q4_gender.png |
Query 4 result screenshot |
q5_top_paid.png |
Query 5 result screenshot |
q7_performance.png |
Query 7 result screenshot |
q8_recruitment.png |
Query 8 result screenshot |
q9_gender_pay.png |
Query 9 result screenshot |
q11_absenteeism.png |
Query 11 result screenshot |
q12_marital.png |
Query 12 result screenshot |
README.md |
Project documentation |
- Source: Kaggle — Human Resources Data Set by Dr. Rich Huebner
- File: HRDataset_v14.csv
- Records: 303 employees
- Columns: 36 features including salary, department, performance, absences
Himanshu Chavhan — Data Analyst https://www.linkedin.com/in/himanshu-chavhan605











