This project is a SQL-based analytical case study focused on Human Resources (HR) data, designed to answer real-world business questions related to workforce structure, compensation, and employee behavior.
Using BigQuery SQL, the analysis explores how organizations can leverage data to make informed decisions about hiring, compensation, team structure, and workforce distribution.
The dataset follows a relational structure similar to enterprise HR systems and includes the following tables:
- employees → Employee details (salary, manager, department, job)
- departments → Department information
- jobs → Job roles and titles
- job_history → Employee role transitions
- locations → Office locations
- countries → Country-level mapping
- regions → Region classification
This case study addresses 9 real-world HR analytics problems:
- Department performance (headcount & salary)
- Departments paying above company average
- Manager effectiveness (team size)
- Role-wise salary distribution
- Workforce distribution by geography
- Identifying inactive departments
- Career mobility analysis (job changes)
- Department × role salary benchmarking
- Top-paying department by region
- Higher headcount departments do not always offer higher salaries
- Certain departments consistently pay above company average, indicating cost concentration
- Managers with large teams may face workload imbalance
- Workforce distribution varies significantly across regions
- Some departments exist without employees, indicating structural inefficiencies
- Employees with multiple job changes may represent high performers or role mismatches
- Aggregations (
COUNT,AVG) - Filtering using
HAVING - Multi-table joins (complex relational queries)
- Subqueries and Common Table Expressions (CTEs)
- Window functions (
RANK()) - Conditional business logic
- Hierarchical relationships (manager → employee)
schema/→ Table definitions, data model and ER Diagram.dataset/→ HR dataset available to download, Individual Tables in .CSV format and all Tables as sheets within a EXCEL filequeries/→ SQL solutions for each business probleminsights/→ Key analytical findingsresults/→ Screenshots of query runs, Sample outputs and validation
- Navigate to
dataset/, Download all the .CSV files, go to your prferred SQL platform, create a DATASET named HR,upload all the table files to it. - Navigate to the
queries/folder - Each file contains:
- Problem statement
- Business context
- SQL solution
- Run queries in BigQuery or MySQL or your desired SQL platform from step 1 or adapt for other SQL environments
- Refer to
insights/for business interpretations - You can use the following document for quick reference of Problem statements and SQL Queries: HR Mini Case Study.docx
- SQL (BigQuery)
- Relational Data Modeling
Shivaling Battarki MIS Executive as Apprentice Exp. | Data Analyst | SQL
Email: shivalingb09@gmail.com
LinkedIn: https://www.linkedin.com/in/shivaling-93000/
HackerRank: https://www.hackerrank.com/profile/shivalingb09
LeetCode: https://leetcode.com/u/shivaling09000330/
Scaler: https://www.scaler.com/academy/profile/e2eb7e7a852d/
GitHub Repository:
https://github.com/Hazardous9hub/HR-ANALYTICS-SQL-CASE-STUDY