Skip to content

himanshuchavhan605/HR-Analytics-SQL-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👥 HR Analytics — SQL Analysis Project

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.


📊 Dashboard Preview

Q1 — Total Employees by Department

Screenshot 2026-03-12 142655

Q2 — Attrition Rate by Department

Screenshot 2026-03-12 142726

Q3 — Average Salary by Position

Screenshot 2026-03-12 142751

Q4 — Gender Distribution by Department

Screenshot 2026-03-12 142827

Q5 — Top 10 Highest Paid Employees

Screenshot 2026-03-12 142858

Q6 — employee Salary by Department

6Screenshot 2026-03-12 142936

Q7 — Performance Score by Department

7Screenshot 2026-03-12 175925

Q8 — Recruitment Source Effectiveness

Screenshot 2026-03-12 143006

Q9 — Gender Pay Gap

Screenshot 2026-03-12 143036

Q10 — Employees by Race

10Screenshot 2026-03-12 170538

Q11 — Absenteeism by Department

Screenshot 2026-03-12 143131

Q12 — Salary by Marital Status

Screenshot 2026-03-12 143158


🎯 Business Problem

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.


💡 Key Insights

# 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)

🛠️ Tools & Technologies

Tool Usage
MySQL Database creation & query execution
MySQL Workbench SQL IDE and result visualization
SQL Data analysis and business insights

📋 Queries Covered

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

📁 Files in this Repo

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

🗄️ Dataset Info

  • 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

👤 Author

Himanshu Chavhan — Data Analyst https://www.linkedin.com/in/himanshu-chavhan605

About

SQL analysis of 303 HR records answering 12 business questions on attrition, salary, gender pay gap & recruitment | MySQL

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors