How to Work with HR Schema Entities
Oracle database is shipped with several sample schemas. These schemas are models for real-world solutions of common business applications such as human resources and order entry. In this topic, we will look at the human resources (HR) schema entities, or tables.
To learn how to work with HR schema entities, follow these steps:
- You'll need to download and install Oracle 12c. The instructions for the setup can be found in How to use sample schemas. Follow steps 1 through 6 before proceeding to the next step.
- We will start by displaying the columns on the
Employees
table. Type in the following statement and press Enter:
Thejob_id
connects the employee to a job in theJobs
table and themanager_id
connects the employee to a manager in theEmployees
table. - Let's select an employee. Type in the following SQL statement and press Enter:
We'll make note of thejob_id
and themanager_id
. - Type in the following select to learn the name of the manager for the employee we selected:
- The
Jobs
table contains a row for each job position. We can display the columns on this table:
- To learn the job title of the employee selected earlier, type in the following select statement:
- The history of positions employees previously held within the company is stored in the
job_history
table:
- In addition to the tables we explored above, the HR schema contains
Departments
(departments in which employees work),Locations
(city and state/province where department is located),Countries
(country of location) andRegions
(region in which country is located, e.g., Germany is in the "Europe" region).