Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

HR Analytics & Workforce Intelligence (SQL Project)

Overview

HR Analytics & Workforce Intelligence is an end-to-end SQL Business Intelligence project designed to analyze employee performance, attendance, compensation, promotions, and workforce trends.

The project simulates a real-world HR database environment using Python-generated datasets and performs advanced workforce analytics using MySQL.

This project demonstrates practical SQL skills including Joins, CTEs, Aggregate Functions, Window Functions, Ranking Functions, and Business Intelligence reporting.


Project Objectives

  • Analyze workforce distribution across departments and cities
  • Evaluate employee attendance and performance trends
  • Compare salary structures across departments
  • Measure promotion rates and promotion patterns
  • Identify high-potential employees for future leadership roles
  • Build business-focused HR insights using SQL

Dataset Information

The dataset was generated using Python and Faker to simulate a realistic HR environment.

Dataset Size

Table Records
Departments 20
Employees 1,000
Attendance Records 12,000
Performance Reviews 1,000
Salary History 1,000
Promotions 1,000

Database Schema

Departments

  • department_id
  • department_name

Employees

  • employee_id
  • employee_name
  • gender
  • city
  • department_id
  • hire_date

Attendance

  • employee_id
  • year
  • month
  • attendance_percent

Performance Reviews

  • employee_id
  • review_year
  • rating

Salary History

  • employee_id
  • salary_year
  • salary

Promotions

  • employee_id
  • promotion_year
  • promoted

SQL Concepts Used

Data Analysis

  • INNER JOIN
  • GROUP BY
  • ORDER BY
  • Aggregate Functions

Advanced SQL

  • Common Table Expressions (CTEs)
  • Window Functions
  • ROW_NUMBER()
  • DENSE_RANK()
  • Ranking Analysis

Business Intelligence

  • Workforce Analysis
  • Salary Analytics
  • Performance Analytics
  • Promotion Analytics
  • Employee Segmentation

Business Questions Answered

Workforce Analytics

  • Total Employees
  • Employees by Department
  • Employees by City

Attendance Analytics

  • Average Attendance
  • Top Consistent Employees
  • Department-wise Attendance

Performance Analytics

  • Average Performance Rating
  • Top Performers
  • Department Performance Ranking

Salary Analytics

  • Average Salary
  • Salary by Department
  • Highest Paid Employees
  • Salary Ranking

Promotion Analytics

  • Promotion Rate
  • Promotions by Department

Advanced Workforce Intelligence

  • Top Earner in Each Department
  • Employee Salary Ranking
  • High-Potential Employee Identification

Key Insights

Workforce Attendance

  • Average Attendance: 84.83%
  • Customer Support Department recorded the highest attendance performance.

Employee Performance

  • Average Employee Rating: 3.53 / 5
  • IT Department achieved the highest average performance rating.

Salary Analysis

  • Finance Department recorded the highest average salary.
  • Multiple departments showed strong compensation competitiveness.

Promotion Analysis

  • Overall Promotion Rate: 50.80%
  • Admin and Training departments recorded the highest promotion counts.

High-Potential Employees

Employees identified with:

  • Attendance above 90%
  • Performance Rating above 4.5
  • No Promotion received

These employees represent strong candidates for future leadership and retention programs.


Project Structure

HR-Analytics-Workforce-Intelligence
│
├── datasets
│   ├── departments.csv
│   ├── employees.csv
│   ├── attendance.csv
│   ├── performance_reviews.csv
│   ├── salary_history.csv
│   └── promotions.csv
│
├── sql_queries
│   ├── database_setup.sql
│   ├── workforce_analytics.sql
│   ├── attendance_analytics.sql
│   ├── performance_analytics.sql
│   ├── salary_analytics.sql
│   ├── promotion_analytics.sql
│   └── advanced_workforce_intelligence.sql
│
├── dataset_generation
│   └── HR_Analytics_Dataset_Generation.ipynb
│
└── README.md

Tools & Technologies

  • Python
  • Pandas
  • Faker
  • MySQL
  • SQL
  • Jupyter Notebook
  • Git
  • GitHub

Learning Outcomes

Through this project I gained hands-on experience in:

  • Designing relational databases
  • Generating realistic datasets using Python
  • Writing business-focused SQL queries
  • Using Window Functions for advanced analytics
  • Building workforce intelligence reports
  • Translating raw data into actionable business insights

Author

Saurav18K.

Aspiring Data Analyst focused on SQL, Python, Data Analytics, and Business Intelligence.

About

Advanced HR Analytics SQL project analyzing 1000 employees using workforce intelligence, attendance analytics, performance reviews, salary analysis, promotion tracking, CTEs, and window functions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages