{"id":26962287,"url":"https://github.com/macdon112/layoff-analysis","last_synced_at":"2026-02-21T20:31:29.614Z","repository":{"id":283472812,"uuid":"951882526","full_name":"Macdon112/Layoff-Analysis","owner":"Macdon112","description":"SQL data cleaning \u0026 analysis of global layoffs","archived":false,"fork":false,"pushed_at":"2025-03-27T20:31:13.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T19:51:50.886Z","etag":null,"topics":["data-analysis","data-cleaning","data-exploration","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Macdon112.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-20T11:49:01.000Z","updated_at":"2025-03-27T20:31:16.000Z","dependencies_parsed_at":"2025-03-20T12:48:11.320Z","dependency_job_id":"7cabf1ae-3bc3-4d0e-addb-464fcbd05edc","html_url":"https://github.com/Macdon112/Layoff-Analysis","commit_stats":null,"previous_names":["macdon112/layoff-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Macdon112/Layoff-Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macdon112%2FLayoff-Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macdon112%2FLayoff-Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macdon112%2FLayoff-Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macdon112%2FLayoff-Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Macdon112","download_url":"https://codeload.github.com/Macdon112/Layoff-Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macdon112%2FLayoff-Analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29692521,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T18:18:25.093Z","status":"ssl_error","status_checked_at":"2026-02-21T18:18:22.435Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","data-cleaning","data-exploration","sql"],"created_at":"2025-04-03T05:19:53.367Z","updated_at":"2026-02-21T20:31:29.596Z","avatar_url":"https://github.com/Macdon112.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Layoffs Data Analysis Project \n\n**Key Goals?** \nI cleaned up a messy dataset of layoffs of companies to make it reliable for analysis.  I removed duplicates, fixed typos, and filled in missing values, preparing it for analysis, and identifying trends, in layoffs  by company, industry and country.\n\n### **Data cleaning steps:**  \n\n1. **Removing Duplicates**\n   Created a staging table (`layoffs_staging2`) to preserve raw data. (Made a backup of the raw data) \n   Spotted repeat entries (like two entries for \"Casper\") and deleted them.  \n        \n2. **Standardised messy details**  \n   Fixed inconsistent categories  \n   Merged *\"cryptocurrency\"* and *\"crypto\"* into one category: **\"crypto\"**.  \n   Cleaned country names (e.g., *\"United States.\"* became *\"United States\"*).  \n   Trimmed spaces in company names (so \"Google \" became \"Google\").  \n\n3. **Handled missing data**  \n   Replaced blank *industry* fields with `NULL` to avoid confusion.  \n   Filled in missing industries using existing data (e.g., used \"Airbnb’s\" industry for its missing entries).  \n   Deleted 4 rows where layoff numbers were missing  \n\n4. **Fixed dates**  \n   Turned text-based dates (like *\"3/12/2022\"*) into proper `DATE` format for smoother analysis.  \n\n## **How to run this project**  \n\n1. **download the files**  \n   **Dataset**: (Data/layoffs.csv)   \n   **SQL scripts**: SQL-Scripts/Data_Cleaning.sql and Data_Exploration.sql.  \n\n2. **Run the SQL scripts** *(in this order)*  \n   **First**: `Data_Cleaning.sql` – cleaning the raw data.  \n   **Then**: `Data_Exploration.sql` – digs into trends (like \"Which industries laid off the most?\").  \n\n## **What I discovered**   \n\n**12 duplicate rows** were removed (e.g., \"Casper\" was listed twice).  \n**\"Crypto\"** became the standard name for all crypto-related industries.  \n**4 incomplete rows** were removed – no half-baked data here  \n\n## Key Insights \n**Biggest layoffs**: Amazon (18,000 employees in 2022).\n**Peak layoffs**: March 2022.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacdon112%2Flayoff-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacdon112%2Flayoff-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacdon112%2Flayoff-analysis/lists"}