{"id":32701209,"url":"https://github.com/sankaran-s2001/layoffs-sql-analysis","last_synced_at":"2026-05-18T05:43:47.316Z","repository":{"id":313222892,"uuid":"1050554781","full_name":"sankaran-s2001/layoffs-sql-analysis","owner":"sankaran-s2001","description":"A complete SQL data cleaning and analysis project using MySQL to analyze global company layoffs from 2020-2023.","archived":false,"fork":false,"pushed_at":"2025-10-08T04:43:42.000Z","size":423,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-08T06:24:11.408Z","etag":null,"topics":["data-science","datacleaning","eda","kaggle","layoffdata","layoffs","mysql","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sankaran-s2001.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-04T15:39:41.000Z","updated_at":"2025-10-08T04:43:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"beadf59c-c5ff-4e57-a973-a95871d9eae4","html_url":"https://github.com/sankaran-s2001/layoffs-sql-analysis","commit_stats":null,"previous_names":["sankaran-s2001/layoffs-sql-analysis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sankaran-s2001/layoffs-sql-analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankaran-s2001%2Flayoffs-sql-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankaran-s2001%2Flayoffs-sql-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankaran-s2001%2Flayoffs-sql-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankaran-s2001%2Flayoffs-sql-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sankaran-s2001","download_url":"https://codeload.github.com/sankaran-s2001/layoffs-sql-analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sankaran-s2001%2Flayoffs-sql-analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282216044,"owners_count":26633413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-01T02:00:06.759Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-science","datacleaning","eda","kaggle","layoffdata","layoffs","mysql","sql"],"created_at":"2025-11-01T23:01:32.364Z","updated_at":"2025-11-01T23:03:44.495Z","avatar_url":"https://github.com/sankaran-s2001.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📊 SQL Layoffs Data Analysis \n\n![MySQL](https://img.shields.io/badge/MySQL-4479A1?style=for-the-badge\u0026logo=mysql\u0026logoColor=white)\n![SQL](https://img.shields.io/badge/SQL-336791?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white)\n![CSV](https://img.shields.io/badge/CSV-FFDD00?style=for-the-badge\u0026logo=files\u0026logoColor=black)\n![DataCleaning](https://img.shields.io/badge/Data--Cleaning-4CAF50?style=for-the-badge\u0026logo=simpleanalytics\u0026logoColor=white)\n![Workbench](https://img.shields.io/badge/MySQL%20Workbench-00758F?style=for-the-badge\u0026logo=mysql\u0026logoColor=white)\n![Kaggle](https://img.shields.io/badge/Kaggle-20BEFF?style=for-the-badge\u0026logo=kaggle\u0026logoColor=white)\n\n\nA complete SQL data cleaning and analysis project using MySQL to analyze global company layoffs from 2020-2023.\n\n## 🎯 What This Project Does\n\nThis project takes messy, real-world layoffs data and cleans it up using SQL, then finds interesting patterns and insights about which companies, industries, and locations were most affected by layoffs.\n\n## 📋 About the Data\n\n**Source**: [Layoffs Dataset from Kaggle](https://www.kaggle.com/datasets/swaptr/layoffs-2022)\n\n- **Size**: 2,300+ layoff records\n- **Time**: 2020-2023\n- **Coverage**: Companies worldwide\n- **Industries**: Tech, Finance, Retail, Healthcare, and more\n\n\n## 🧹 What I Did - Data Cleaning\n\n### Step 1: Remove Duplicates\n\n- Found and removed duplicate records\n- Used SQL window functions to identify copies\n\n\n### Step 2: Fix Data Problems\n\n- Cleaned company names (removed extra spaces)\n- Fixed industry names (made \"Crypto\" consistent)\n- Fixed country names (removed dots from \"United States.\")\n- Changed date format from text to proper dates\n\n\n### Step 3: Handle Missing Data\n\n- Filled in missing industry info when possible\n- Removed records that had no useful layoff numbers\n\n\n## 📊 Key Findings\n\n### 🏢 Top 5 Companies with Most Layoffs\n![output Screenshot](images/Top_5_companies_by_total_layoffs.jpg)\n\n### 🌍 Top 5 Locations with Most Layoffs\n![output Screenshot](images/Top_5_locations_by_total_layoffs.jpg)\n\n### 🏭 Top 5 Industries with Most Layoffs\n![output Screenshot](images/Top_5_industries_by_total_layoffs.jpg)\n\n### 📈 Biggest Single Layoff Event\n![output Screenshot](images/Max_single_layoff.jpg)\n\n### 💔 Companies That Shut Down Completely (100% Layoffs)\n![output Screenshot](images/Companies_with_100_percentage_layoffs.jpg)\n\n## 🛠️ SQL Skills Used\n\n- **Data Cleaning**: Removing duplicates, fixing messy data\n- **Window Functions**: ROW_NUMBER(), RANK(), SUM() OVER()\n- **Joins**: Connecting tables to fill missing data\n- **Date Functions**: Converting text to dates\n- **Aggregation**: GROUP BY, SUM(), COUNT(), MAX()\n- **CTEs**: Common Table Expressions for complex queries\n\n\n## 📁 Project Files\n\n```\n📦 layoffs-sql-analysis\n├── 📄 README.md                  (This file)\n├── 📂 data/\n│   └── 📄 layoffs.csv            (Original dataset)\n├── 📂 sql/\n│   ├── 📄 data_cleaning.sql      (Cleaning queries)\n│   └── 📄 eda.sql               (Analysis queries)\n└── 📂 images/\n    ├── 📷 top_companies.png      (Results screenshots)\n    ├── 📷 top_locations.png\n    ├── 📷 top_industries.png\n    ├── 📷 max_layoffs.png\n    └── 📷 complete_shutdowns.png\n```\n\n\n## 🚀 How to Run This Project\n\n### What You Need\n\n- MySQL installed on your computer\n- MySQL Workbench (makes it easier)\n\n\n### Steps\n\n1. **Download** the files from this repository\n2. **Open** MySQL Workbench\n3. **Create** a new database called `world_layoff`\n4. **Import** the `layoffs.csv` file as a table called `layoffs`\n5. **Run** the `data_cleaning.sql` file first\n6. **Run** the `eda.sql` file second to see the analysis\n\n## 💡 What I Learned\n\n- How to clean messy real-world data\n- Advanced SQL techniques for data analysis\n- Finding business insights from raw data\n- Documenting and presenting data projects\n\n\n## 🎓 Why This Project Matters\n\nThis project shows I can:\n\n- ✅ Take messy data and make it clean and usable\n- ✅ Write complex SQL queries to find insights\n- ✅ Present findings in a clear, understandable way\n- ✅ Work with real business data to solve problems\n\n\n## ✉️ Contact\n\n**Sankaran S**  \n[![GitHub](https://img.shields.io/badge/GitHub-181717?style=for-the-badge\u0026logo=github\u0026logoColor=white)](https://github.com/sankaran-s2001) [![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/in/sankaran-s21/) [![Email](https://img.shields.io/badge/Email-D14836?style=for-the-badge\u0026logo=gmail\u0026logoColor=white)](mailto:sankaran121101@gmail.com)\n\n***\n\n*This project is part of my data science portfolio, showing my SQL skills and ability to work with real-world data.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsankaran-s2001%2Flayoffs-sql-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsankaran-s2001%2Flayoffs-sql-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsankaran-s2001%2Flayoffs-sql-analysis/lists"}