A SQL-based project analyzing a real-world dataset of global layoffs — covering company, industry, country, and funding-stage details — to uncover patterns in workforce reductions over time.
To clean a messy, duplicate-laden real-world dataset into an analysis-ready form, then explore it to answer:
- Which industries and countries saw the sharpest layoffs?
- How did layoffs trend month-over-month and year-over-year?
- Which companies and funding stages were hit hardest?
- MySQL — data cleaning, transformation, and analysis
- SQL techniques: CTEs, window functions, aggregations, rolling totals, ranking functions
-
Data Cleaning (
data cleaning.sql)- Identified and removed duplicate records using window functions (
ROW_NUMBER()partitioned over key columns) - Standardized inconsistent text fields (company names, industry labels, country names)
- Handled NULL and blank values, converting date fields to proper
DATEtypes - Removed unnecessary columns after cleaning
- Identified and removed duplicate records using window functions (
-
Exploratory Data Analysis (
EDA.sql)- Identified companies and industries with the highest total layoffs
- Used rolling totals (via window functions) to track cumulative layoffs by month
- Ranked top companies per year using
DENSE_RANK() - Compared layoffs across funding stages to see whether well-funded companies were more or less affected
- Duplicate detection and data standardization on a messy real-world dataset
- Time-series analysis using rolling/cumulative aggregations in pure SQL
- Ranking and cohort-style comparisons across categorical dimensions (industry, country, funding stage)
data cleaning.sql— full cleaning pipelineEDA.sql— exploratory analysis querieslayoffs.csv— source dataset