Intermediate14 columnsUp to 10,000 rows Fictional data

Employee & Attrition Records dataset

An HR file of employees with salary, satisfaction, overtime and whether they left: built for attrition analysis.

Made the moment you click and sent straight to you. Nothing is saved on our server.

About this dataset

A fictional company's HR export: one row per employee, with department, role, city, joining date, monthly salary, whether they regularly work overtime, how satisfied they said they were, their last performance rating, and the column everyone cares about: attrition, whether they left.

Attrition is a classic first machine-learning problem because the answer is a simple Yes/No and the reasons are human and easy to reason about. The file is also handy for plain spreadsheet practice: salary bands, headcount by department, average tenure, and lookups.

Good for practising: Classification, Feature analysis, Excel lookups, Data visualisation.

What's built into the data

The rows are random, but they follow rules, so there is something real to find. These are the patterns to look for:

  • Employees who work overtime, report low satisfaction (1–2), are under 30, or are junior and paid under ₹30,000 a month are noticeably more likely to leave.
  • People with five or more years at the company are less likely to leave.
  • Engineering pays the most and Customer Support the least; each step up in seniority adds roughly 65% to pay.
  • Roughly one employee in five leaves, so the classes are imbalanced, as they usually are in real HR data.
  • years_at_company is counted up to 31 March 2026 and always agrees with date_of_joining.

Columns

ColumnTypeDescription
emp_idID (text)Employee number.
full_nameTextFictional name.
genderCategoryMale or Female.
ageWhole numberAge in years.
departmentCategoryOne of seven departments.
job_roleCategoryRole title; three levels of seniority per department.
cityCategoryOffice city.
date_of_joiningDateDate the employee joined.
years_at_companyWhole numberComplete years served as of 31 Mar 2026.
monthly_salaryAmount (₹)Gross monthly salary in rupees.
overtimeTRUE / FALSETrue if the employee regularly works overtime.
job_satisfactionWhole numberSelf-reported, 1 (very low) to 5 (very high).
performance_ratingWhole numberLast appraisal, 1 to 5.
attritionCategoryYes if the employee left, No otherwise.

Preview: the first 8 rows

A sample with seed 2026. Your download will have different values but the same columns and patterns.

emp_idfull_namegenderagedepartmentjob_rolecitydate_of_joiningyears_at_companymonthly_salaryovertimejob_satisfactionperformance_ratingattrition
EMP00001Varun FernandesMale48OperationsOperations ManagerKolkata2016-09-24969000FALSE44No
EMP00002Aarav BansalMale21SalesSales ExecutivePune2026-03-01028400FALSE43No
EMP00003Mary BanerjeeFemale31MarketingMarketing ExecutivePune2024-07-11127300TRUE44Yes
EMP00004Simran AnsariFemale29Human ResourcesHR ExecutiveHyderabad2023-05-16231200FALSE44No
EMP00005Revathi ChauhanFemale25MarketingMarketing ExecutiveChennai2026-01-27031200FALSE44No
EMP00006Abhishek DeshmukhMale26Customer SupportSupport AssociateHyderabad2023-07-14224400FALSE53No
EMP00007Varun SheikhMale29Customer SupportSupport AssociateHyderabad2026-03-01021600FALSE33No
EMP00008Ankit AnsariMale43FinanceFinance AnalystKolkata2013-08-271268000TRUE33Yes

Practice exercises

  1. Find the attrition rate for each department, and for overtime vs no overtime. Which single factor matters most?
  2. Plot monthly salary by job role as box plots. Are there outliers inside a role?
  3. Build a logistic regression or decision tree to predict attrition. Report precision and recall, not just accuracy.
  4. Because only about 1 in 5 employees leave, compare a model that always says 'No' with yours. Did you beat it?
  5. Make an Excel salary band table (under 30k, 30–50k, 50–80k, 80k+) with COUNTIFS and the attrition rate in each band.

Stuck on one? Each exercise uses ideas from the lessons below, and trying it with the messy option on turns it into a cleaning exercise as well.

Load it straight into Python

You don't have to download first. Pandas can read the link directly, in Jupyter, Google Colab or a script. Keep the seed so you get the same data every time you run the notebook:

import pandas as pd

url = "https://beeprotonai.info/resources/datasets/employees/download/?rows=1000&seed=42"
df = pd.read_csv(url, parse_dates=["date_of_joining"])
df.head()

For SQL practice, download the SQL format and run it against an empty database, for example sqlite3 practice.db < employees-1000-rows-seed42.sql or mysql -u root -p practice < employees-1000-rows-seed42.sql (use your file's name). It creates a table called employees and fills it.

About the data

Everything in this file is invented. Names are random pairings of common first names and surnames, email addresses use example.com (reserved for examples, so it can never reach anyone), and phone numbers start with +91 00, which no real Indian mobile number does. Any resemblance to a real person or business is coincidence. Dates run from 1 April 2024 to 31 March 2026 unless a column says otherwise. Use it freely for learning, teaching and projects, including commercial ones, with no attribution required (CC0).

Lessons that go with it

More datasets

See all 14 datasets →