Sample HR attrition data
Updated 3 November 2026. Fictional U.S. businesses and people, generated with a fixed seed.
What is in it
Each row is one fictional employee: department, title, hire date, tenure, monthly pay, overtime, two survey scores, commute distance, years since promotion and whether they left during 2024. Leaving is more likely with overtime, low satisfaction, low pay and long commutes, so the file has a pattern to find.
More practice tables like this one: all 14 newer sample datasets.
First rows
point at a column to light it up
| employee_idtext | agenumber | departmenttext | job_titletext | hire_datedate | years_at_companynumber | monthly_incomenumber | overtimeyes/no | job_satisfactionnumber | work_life_balancenumber | distance_from_home_minumber | last_promotion_yearsnumber | attritionyes/no |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| HR30001 | 41 | Sales | Sales Representative | 2023-05-31 | 1.6 | 4900 | FALSE | 4 | 2 | 13 | 1 | FALSE |
| HR30002 | 26 | Engineering | QA Engineer | 2019-09-10 | 5.3 | 8330 | TRUE | 4 | 2 | 10 | 5 | FALSE |
| HR30003 | 36 | IT | IT Support Technician | 2013-10-27 | 11.2 | 5660 | TRUE | 3 | 2 | 2 | 0 | FALSE |
| HR30004 | 33 | IT | IT Manager | 2014-12-17 | 9.6 | 7530 | TRUE | 2 | 4 | 8 | 0 | TRUE |
| HR30005 | 45 | Engineering | Senior Software Engineer | 2017-03-18 | 7.8 | 11450 | FALSE | 3 | 3 | 8 | 3 | FALSE |
| HR30006 | 35 | Engineering | Software Engineer | 2019-03-02 | 5.8 | 9250 | FALSE | 4 | 4 | 2 | 1 | FALSE |
| HR30007 | 32 | Operations | Logistics Analyst | 2015-06-18 | 9.5 | 4520 | FALSE | 1 | 3 | 8 | 5 | FALSE |
| HR30008 | 48 | Customer Support | Customer Success Manager | 2019-01-26 | 5.9 | 7560 | TRUE | 4 | 3 | 7 | 0 | FALSE |
| HR30009 | 35 | Engineering | QA Engineer | 2022-01-22 | 2.9 | 7690 | TRUE | 4 | 2 | 4 | 0 | FALSE |
| HR30010 | 31 | Marketing | Marketing Specialist | 2018-06-19 | 6.5 | 7230 | FALSE | 2 | 3 | 5 | 1 | FALSE |
Attrition rate by department
% who left, 1,000-row file
Show as a table
| department | value |
|---|---|
| IT | 25.0 |
| Marketing | 18.4 |
| Operations | 16.0 |
| Finance | 16.0 |
| Human Resources | 13.5 |
| Sales | 13.3 |
| Customer Support | 12.5 |
| Engineering | 10.4 |
Data dictionary
| Column | Type | Meaning |
|---|---|---|
| employee_id | text | Employee number |
| age | integer | Age in years, 20-62 |
| department | text | One of 8 departments |
| job_title | text | Job title |
| hire_date | date | Start date (2010-2024, at age 18 or older) |
| years_at_company | decimal | Years from hire_date to 2024-12-31 (or to the leaving date) |
| monthly_income | integer | Monthly base pay (USD, fictional) |
| overtime | boolean | Works regular overtime (TRUE/FALSE) |
| job_satisfaction | integer | Survey score 1 (low) to 4 (high) |
| work_life_balance | integer | Survey score 1 (low) to 4 (high) |
| distance_from_home_mi | integer | Commute distance in miles |
| last_promotion_years | integer | Years since last promotion |
| attrition | boolean | Left the company in 2024 (TRUE/FALSE) |
Practice questions
answers checked in SQL and in Python
What share of employees left in 2024?
14.6%
Excel
=COUNTIF(M:M,TRUE)/1000SQL
SELECT ROUND(100.0*SUM(attrition)/COUNT(*),1) FROM hr_attritionFile: hr-attrition-1000
Attrition rate with and without overtime?
overtime TRUE: 22.4%; overtime FALSE: 11.4%
Excel
=COUNTIFS(H:H,TRUE,M:M,TRUE)/COUNTIF(H:H,TRUE)SQL
SELECT CASE WHEN overtime THEN 'TRUE' ELSE 'FALSE' END AS ot, ROUND(100.0*SUM(attrition)/COUNT(*),1) AS pct FROM hr_attrition GROUP BY ot ORDER BY pct DESC, otFile: hr-attrition-1000
Attrition rate by department?
IT 25.0%; Marketing 18.4%; Finance 16.0%; Operations 16.0%; Human Resources 13.5%; Sales 13.3%; Customer Support 12.5%; Engineering 10.4%
SQL
SELECT department, ROUND(100.0*SUM(attrition)/COUNT(*),1) AS pct FROM hr_attrition GROUP BY department ORDER BY pct DESC, departmentFile: hr-attrition-1000