Summary: in this tutorial, you will learn about a SQL Sample Database called HR that manages the HR data of the small businesses.
The following database diagram illustrates the HR sample database:

The HR sample database has seven tables:
- The
employeestable stores the data of employees. - The
jobstable stores the job data including job title and salary range. - The
departmentstable stores department data. - The
dependentstable stores the employee’s dependents. - The
locationstable stores the location of the departments of the company. - The
countriestable stores the data of countries where the company is doing business. - The
regionstable stores the data of regions such as Asia, Europe, America, and the Middle East and Africa. The countries are grouped into regions.
The following picture shows the table names and their records.

Typically, you need to install a Relational Database Management System (RDBMS) to work with SQL.
If you have worked with an RDBMS such as MySQL, PostgreSQL, Oracle Database, and SQL Server, you can use the following script to create the sample database in one of these databases.
MySQL
The following SQL script creates the HR sample database in MySQL:
The following script allows you to insert data into the tables in MySQL:
Microsoft SQL Server
The following script creates the HR sample database structure in Microsoft SQL Server.
The following script allows you to insert data into the tables:
Oracle Database
The following script creates the HR sample database structure in Oracle Database 12c and further version.
The following script inserts data into the tables in the Oracle database:
SQLite
The following script creates the HR sample database structure in SQLite.
The following script inserts data into the tables in the SQLite:
Removing tables
The following is the script that drops all tables in case you want to refresh the sample database.
DROP TABLE employees;
DROP TABLE dependents;
DROP TABLE departments;
DROP TABLE locations;
DROP TABLE countries;
DROP TABLE regions;
DROP TABLE jobs;


Pingback: SQL INNER JOIN - sqltutorial
Pingback: SQL LEFT JOIN - sqltutorial
Pingback: SQL Subquery - sqltutorial