This repository contains SQL scripts and analysis based on a corporate employee management database. The goal is to demonstrate SQL proficiency through real-world HR analytics use-cases, including:
- Workforce distribution
- Department history
- Job title progression
- Salary analysis
- Gender pay gap insights
| Table | Description |
|---|---|
employees |
Personal info for each employee |
departments |
Department list |
dept_emp |
Employee ↔ Department history |
dept_manager |
Department manager history |
titles |
Job title history |
salaries |
Salary history |
Reusable logical views are stored in views/:
dept_emp_latest_date.sql: Latest dept assignment datescurrent_dept_emp.sql: Current department assignment
- Relational database design
- JOINs across multiple tables
- Views for current-state analysis
- Aggregations and subqueries
- Real-world HR and payroll analytics
- Current workforce distribution
- Department payroll costs
- Career progression patterns
- Gender-based salary comparisons
- MySQL