Employee & Attrition Records dataset
An HR file of employees with salary, satisfaction, overtime and whether they left: built for attrition analysis.
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
| Column | Type | Description |
|---|---|---|
emp_id | ID (text) | Employee number. |
full_name | Text | Fictional name. |
gender | Category | Male or Female. |
age | Whole number | Age in years. |
department | Category | One of seven departments. |
job_role | Category | Role title; three levels of seniority per department. |
city | Category | Office city. |
date_of_joining | Date | Date the employee joined. |
years_at_company | Whole number | Complete years served as of 31 Mar 2026. |
monthly_salary | Amount (₹) | Gross monthly salary in rupees. |
overtime | TRUE / FALSE | True if the employee regularly works overtime. |
job_satisfaction | Whole number | Self-reported, 1 (very low) to 5 (very high). |
performance_rating | Whole number | Last appraisal, 1 to 5. |
attrition | Category | Yes 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_id | full_name | gender | age | department | job_role | city | date_of_joining | years_at_company | monthly_salary | overtime | job_satisfaction | performance_rating | attrition |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| EMP00001 | Varun Fernandes | Male | 48 | Operations | Operations Manager | Kolkata | 2016-09-24 | 9 | 69000 | FALSE | 4 | 4 | No |
| EMP00002 | Aarav Bansal | Male | 21 | Sales | Sales Executive | Pune | 2026-03-01 | 0 | 28400 | FALSE | 4 | 3 | No |
| EMP00003 | Mary Banerjee | Female | 31 | Marketing | Marketing Executive | Pune | 2024-07-11 | 1 | 27300 | TRUE | 4 | 4 | Yes |
| EMP00004 | Simran Ansari | Female | 29 | Human Resources | HR Executive | Hyderabad | 2023-05-16 | 2 | 31200 | FALSE | 4 | 4 | No |
| EMP00005 | Revathi Chauhan | Female | 25 | Marketing | Marketing Executive | Chennai | 2026-01-27 | 0 | 31200 | FALSE | 4 | 4 | No |
| EMP00006 | Abhishek Deshmukh | Male | 26 | Customer Support | Support Associate | Hyderabad | 2023-07-14 | 2 | 24400 | FALSE | 5 | 3 | No |
| EMP00007 | Varun Sheikh | Male | 29 | Customer Support | Support Associate | Hyderabad | 2026-03-01 | 0 | 21600 | FALSE | 3 | 3 | No |
| EMP00008 | Ankit Ansari | Male | 43 | Finance | Finance Analyst | Kolkata | 2013-08-27 | 12 | 68000 | TRUE | 3 | 3 | Yes |
Practice exercises
- Find the attrition rate for each department, and for overtime vs no overtime. Which single factor matters most?
- Plot monthly salary by job role as box plots. Are there outliers inside a role?
- Build a logistic regression or decision tree to predict attrition. Report precision and recall, not just accuracy.
- Because only about 1 in 5 employees leave, compare a model that always says 'No' with yours. Did you beat it?
- 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
Two years of orders from a fictional chain of Indian sweet shops, with Diwali …
Student Exam ResultsMarks in five subjects with attendance and study hours, plus totals, percentage, result and …
Customer List (CRM)Customer records with contact details, segment, orders and spend: ideal for cleaning, deduplication and …
Stock Register (Inventory)Monthly stock register for five warehouses: opening, received, issued, closing, reorder level and value.
Website Traffic (Analytics)Daily sessions, users, bounce rate and conversions by page, traffic source and device.
Daily City WeatherSimulated daily temperature, rain, humidity and AQI for Indian cities, with monsoon and winter …