• 3 tables
  • 6,627 rows
  • 7 formats
  • SQL edition
  • synthetic data

Employee Dataset for SQL Practice

This ready-made employee dataset is designed for students to practice SQL joins. It includes 3 tables with 6,627 rows in total, covering departments, employees, and salaries. Preview rows are available for free, with the full download costing credits.

  • last updated 2 Nov 2026
  • by GoMask
  • Dataset contains 3 tables: departments, employees, and salaries.
  • Total of 6,627 rows across all tables.
  • Employee data spans from 2010-01-01 to 2023-12-26.
  • Salary amounts range from 47,510.72 to 125,341.29.
  • Includes 1,000 preview rows available for free.

At a glance

  • 3tables
  • 6,627rows
  • 13columns
  • Jan 2010 – Dec 2023date range

The 3 tables

preview and data dictionary per table

Departments departments · dimension table · 10 rows

Contains information about different company departments.

Preview

First 10 of 10 rows of the Departments table
department_iduuiddepartment_namestringlocationstring
ec164d08-c9b0-4262-a2cf-4b961803792bOperationsNew York
51558957-4d0a-4142-a6fc-bbcd51fbb182FinanceNew York
0a778a7a-08ba-41a4-8d3b-c4595f6a35f3SalesChicago
e66c9bcb-72d3-4e34-81e0-43e67ffe2132MarketingNew York
ad81469b-de01-4624-a980-c2b1e05012dcResearch & DevelopmentSan Francisco
a9bd365f-b2cc-4847-89fd-d35be7e878d6Product ManagementAustin
585de48f-14cb-431e-904b-ed30fe5f2ef7EngineeringSan Francisco
34d43975-3a91-4b0d-8284-bb9d06875a61HRAustin
9477015b-c015-482d-86b8-bb08c55a4ba1Customer SupportBoston
52b7abec-26a7-41e9-b5d4-15e7e90ec80dLegalNew York
10 of 10 rows · 3 columns

Data dictionary

Data dictionary for the Departments table
columntypedescriptionexamplenull %
department_iduuidUnique identifier for each department.uniqueec164d08-c9b0-4262-a2cf-4b961803792b0%
department_namestringName of the business department.uniqueOperations0%
locationstringPrimary office hub or operating location for the department.New York0%

Employees employees · table · 3,000 rows

Lists employee details including their position and department.

Preview

First 10 of 3,000 rows of the Employees table
employee_iduuidfirst_namestringlast_namestringhire_datedatepositionstringdepartment_iduuid
441da94b-0d04-48c4-9bd6-cf1509d36b67OliviaSmith2017-04-19Data Analyst585de48f-14cb-431e-904b-ed30fe5f2ef7
16c50dde-4ed0-4ff4-9ecc-99d4fe31a23fNoahStewart2014-02-07Data Analyst51558957-4d0a-4142-a6fc-bbcd51fbb182
bf3922b1-b4ef-4d0d-b6d8-1c5d04f837d5EmmaScott2021-04-14Software Engineer51558957-4d0a-4142-a6fc-bbcd51fbb182
2a22aeab-c6be-43b7-9b3c-9db9a72635bbLiamSullivan2010-05-03Software Engineer585de48f-14cb-431e-904b-ed30fe5f2ef7
a03e696b-be93-49c6-8759-439332e383ffAvaStone2013-05-09Software Engineer52b7abec-26a7-41e9-b5d4-15e7e90ec80d
b57f43e5-9b6a-4682-b81c-79d5603e9d02ElijahSnyder2023-09-22Software Engineer0a778a7a-08ba-41a4-8d3b-c4595f6a35f3
fc05f821-286e-4bca-b6a2-971d74c150faOliviaSimon2019-06-14Software Engineer51558957-4d0a-4142-a6fc-bbcd51fbb182
efb6d713-c39a-4e9f-8e53-0cc39b477763JamesSharp2019-12-18Software Engineere66c9bcb-72d3-4e34-81e0-43e67ffe2132
6a7ac9cf-6db1-4089-be26-2498e452cec7IsabellaSpencer2022-11-21Data Analyst51558957-4d0a-4142-a6fc-bbcd51fbb182
f406d298-141c-4129-a449-97cc77794c03BenjaminSterling2016-07-29Software Engineera9bd365f-b2cc-4847-89fd-d35be7e878d6
10 of 3,000 rows · 6 columns

Data dictionary

Data dictionary for the Employees table
columntypedescriptionexamplenull %
employee_iduuidPrimary key unique identifier for the employee.unique441da94b-0d04-48c4-9bd6-cf1509d36b670%
first_namestringEmployee's first name, predominantly common US names.Olivia0%
last_namestringEmployee's last name or surname, predominantly common US surnames.Smith0%
hire_datedateDate on which the employee was hired, bounded between 2010 and 2023.2017-04-190%
positionstringJob title or position held by the employee.Data Analyst0%
department_iduuidForeign key to departments.department_id.585de48f-14cb-431e-904b-ed30fe5f2ef70%

Salaries salaries · fact table · 3,617 rows

Records salary information for employees, including effective dates.

Preview

First 10 of 3,617 rows of the Salaries table
salary_iduuidamountdecimaleffective_datedateemployee_iduuid
1175d3de-3016-4493-9a5b-de05fa9e1c5096078.122022-04-046a56f5cf-d453-4bdf-875b-631c3ba350cf
74b30750-f7f0-4b86-b16a-792c27031726112890.872020-03-1630f17346-e311-47ab-970a-e4721bd6f988
108b2126-3cf3-4ae9-8395-60882d272e9e79312.542022-04-052c9d350c-b666-434c-9e68-0629f5cee062
632b25ae-bcf7-4758-bb8b-3ba525e603d9113726.122021-05-051b91444e-b06e-4a07-9475-3190adb079ba
a96a3f32-c96d-43dd-a2fd-c819371072d582670.792023-06-214ccc595c-b734-43de-978c-a0fd634a2167
4d587916-9cc9-464b-9b4e-7a80e393f33480229.252021-05-04052c3a7a-377d-4de1-a691-c38213763a71
6a67af71-5972-4de9-b8bb-03fcf217fd25100025.242017-05-17fbc63582-e6ab-43fc-88cd-4c72c73cfcfd
15002647-140a-45be-884b-7d3c25e0b9b693240.492010-01-134de3bdd6-256f-4510-8b5c-63e7f03a4256
b8871a79-7b9c-4a1c-88cd-2e9aa882222874331.512014-05-1477f3ca92-b909-4acd-8f49-fb8e7c106424
3e5d58b1-2152-41d2-879f-76978c94632559455.72019-08-1508932d21-34d0-4208-b31e-b0b3f59cb642
10 of 3,617 rows · 4 columns

Data dictionary

Data dictionary for the Salaries table
columntypedescriptionexamplenull %
salary_iduuidUnique identifier for the salary record.unique1175d3de-3016-4493-9a5b-de05fa9e1c500%
amountdecimalAnnual base salary amount in USD.96078.120%
effective_datedateDate on which the specified salary amount became effective.2022-04-040%
employee_iduuidForeign key to employees.employee_id.6a56f5cf-d453-4bdf-875b-631c3ba350cf0%

How the tables join

  • employees.department_id references departments.department_idmany to one: each Employees row points to one Departments row
  • salaries.employee_id references employees.employee_idmany to one: each Salaries row points to one Employees row

Questions to answer with it

  1. Write a SQL query to find the average salary for each department, joining employees and departments tables.

    You will need to join the employees table with the departments table on department_id and then join with the salaries table on employee_id to calculate the average salary per department.

    tables: employees, departments, salaries

  2. Write a SQL query to list all employees hired in the last year, ordered by hire date.

    Filter the employees table for hire_date within the last year from the current date.

    tables: employees

  3. Write a SQL query to identify employees who have not had a salary update in the last two years.

    Join employees and salaries tables, then filter for employees whose latest salary effective_date is older than two years ago.

    tables: employees, salaries

  4. Find the employee with the highest salary using a window function.

    Use a window function like ROW_NUMBER() or RANK() partitioned by employee and ordered by salary amount descending.

    tables: employees, salaries

Starter SQL

run against this data before publishing

Table names match the SQLite file and the SQL script.

Average Salary per Department

sql
SELECT d.department_name, AVG(s.amount) AS average_salary
FROM departments d
JOIN employees e ON d.department_id = e.department_id
JOIN salaries s ON e.employee_id = s.employee_id
GROUP BY d.department_name
LIMIT 20;

Employees Without Recent Salary Updates

sql
SELECT e.employee_id, e.first_name, e.last_name, MAX(s.effective_date) AS last_salary_update
FROM employees e
LEFT JOIN salaries s ON e.employee_id = s.employee_id
GROUP BY e.employee_id, e.first_name, e.last_name
HAVING last_salary_update < date('now', '-2 years') OR last_salary_update IS NULL
LIMIT 20;

Employee with Highest Salary

sql
SELECT employee_id, first_name, last_name, amount
FROM (
  SELECT 
    e.employee_id, 
    e.first_name, 
    e.last_name, 
    s.amount,
    ROW_NUMBER() OVER (ORDER BY s.amount DESC) as rn
  FROM employees e
  JOIN salaries s ON e.employee_id = s.employee_id
) AS ranked_salaries
WHERE rn = 1
LIMIT 20;

Load it with pandas

python
import pandas as pd

# Unzip the CSV download first: one file per table
departments = pd.read_csv("departments.csv")
employees = pd.read_csv("employees.csv")
salaries = pd.read_csv("salaries.csv")

# Join employees to departments
df = employees.merge(departments, left_on="department_id", right_on="department_id", how="left", suffixes=("", "_departments"))
print(df.groupby("department_name").size().sort_values(ascending=False))

Using it in your tool

Excel
The dataset can be downloaded in XLSX format. Each table will be on a separate sheet.
Power BI
The dataset is available in multiple formats, including CSV and Excel, which can be easily imported into Power BI for visualization.
SQL
The dataset is provided as a SQLite database script. You can load this script into a SQLite client to practice SQL queries. The tables are 'departments', 'employees', and 'salaries'. Relationships are established via 'department_id' and 'employee_id'.
Python
The dataset is available in CSV and JSON formats, suitable for loading into pandas DataFrames for analysis with Python.

Formats available

  • CSV (zip)One CSV file per table, zipped
  • Excel workbookOne worksheet per table
  • SQLite databaseA ready-to-query database file with every table
  • Parquet (zip)One Parquet file per table, zipped
  • SQL scriptCREATE TABLE with primary and foreign keys, then INSERTs
  • CSVA single CSV file
  • JSONA single JSON file

How this data was generated

Synthetic data. Every row was generated: no real people, customers or companies are in this dataset.

Synthetic data generated by GoMask DataFactory from a relational blueprint: keys, links and rules are enforced in code, text columns are filled by a language model. No real people, companies or transactions.

  • The dataset was generated using GoMask DataFactory.
  • Data includes synthetic employee, department, and salary information.
  • Key fields are designed to facilitate SQL join practice.
  • Checked by an automated quality gate: unique keys, no orphan foreign keys, required columns filled, declared rules and date ranges (realism score 100).

Limitations

  • The dataset is synthetic and does not represent real-world individuals or companies.
  • The number of rows in the 'salaries' table is greater than the number of employees, indicating multiple salary records per employee.
  • The date range for hire and effective dates is limited to 2010-2023.
  • Distributions and correlations are modelled, not measured from real records.

blueprint · employee-dataset-for-sql

Scale this dataset

Same tables. As many rows as you need.

Open the blueprint behind these 3 tables in Data Factory: keep the relationships, change a column, and generate it at the size you need.

  • 200,000 rows
  • 1,000,000 rows
Scale this dataset in Data Factory
Tables
departments, employees, salaries
Licence
yours to use, including commercially
API slug
employee-dataset-for-sql

What should your data show?

Preview 20 rows free
No signup. No card.