All work

Global layoff analysis

SQL analysis of layoffs across industries, countries, company stages and time.

Discipline
Data analysis
When
Apr 2026
Tools
SQL
SQL from Data Cleaning.sql: a ROW_NUMBER() window over every column to find duplicate layoff records

The challenge

Layoff data is messy and inconsistent. It needed cleaning before it could say anything reliable about which industries, countries and kinds of company were cutting jobs, and when.

My approach

I used SQL for the whole pipeline: a staging table for cleaning, then exploratory queries grouped by industry, company, country, stage and month.

Process

  1. Removed duplicates, handled missing values and fixed inconsistent entries.
  2. Ranked industries, companies, countries and funding stages by layoffs with GROUP BY and aggregate queries.
  3. Tracked layoffs by country and industry per year, and by month.
  4. Built a rolling total to show the cumulative effect over time.

What I found

  • The largest single layoff in the data came from the Consumer industry, at 12,000 people.
  • Some companies laid off 100% of staff, pointing to closures or market exits.
  • A small number of companies account for a large share of all layoffs.
  • Layoffs come in monthly spikes rather than a steady trend, and the rolling total keeps rising.

Recommendations

  • Flexible staffing and demand forecasting in high-risk industries.
  • Cash reserves and more diverse revenue to absorb shocks.
  • Hiring for early-stage companies that tracks realistic revenue.
SQL from Exploratory Data Analysis.sql: monthly layoffs with a rolling total using a CTE and a window function
SQL from Data Cleaning.sql: converting text dates with STR_TO_DATE and changing the column type to DATE