Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧹 Layoffs Data Cleaning — SQL Portfolio Project

A data cleaning project using MySQL that takes raw tech layoffs data and transforms it into a clean, analysis-ready dataset through a structured staging pipeline.

📋 Project Overview

This project demonstrates real-world SQL data cleaning techniques applied to a dataset of tech company layoffs. The goal is to remove duplicates, standardize values, handle null/blank fields, and prepare the data for exploratory data analysis (EDA).

📁 Files

File Description
layoffs.csv Raw source data — tech layoffs dataset
cleaned.csv Final cleaned and processed output
protifolio.sql Full SQL data cleaning pipeline

🔄 Pipeline

layoffs.csv
    │
    └──► layoffs (raw table)
              │
              └──► layoffs_staging (duplicate detection)
                        │
                        └──► layoffs_staging2 (cleaning & standardization)
                                  │
                                  └──► cleaned.csv (final output)

🛠️ Cleaning Steps Performed

  1. Duplicate Removal — Used ROW_NUMBER() with PARTITION BY to identify and delete duplicate records
  2. Standardization
    • Trimmed whitespace from company names
    • Unified industry labels (e.g., crypto, Crypto CurrencyCrypto)
    • Fixed country names (e.g., United States.United States)
  3. Date Formatting — Converted text dates to proper DATE type using STR_TO_DATE()
  4. Null & Blank Handling — Filled in missing industry values via self-join; removed rows with no usable data
  5. Schema Cleanup — Dropped helper columns (row_num) after use

🧰 Tech Stack

  • Database: MySQL
  • Language: SQL
  • Techniques: CTEs, Window Functions, Self Joins, String Functions, Type Casting

📊 Dataset

The dataset contains records of tech company layoffs including:

  • Company name & location
  • Industry & stage
  • Total laid off & percentage laid off
  • Date & funds raised (millions)

🚀 How to Use

  1. Import layoffs.csv into MySQL as the layoffs table
  2. Run protifolio.sql sequentially to execute the full cleaning pipeline
  3. The final cleaned data will be in the layoffs_staging2 table (also exported as cleaned.csv)

Portfolio project by Rohith Sunkari

About

SQL data cleaning project on tech layoffs data — deduplication, standardization, and null handling using MySQL

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors