How to Use Sample Schemas
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.
To learn how to use sample schemas in Oracle database, follow these steps:
- Download Oracle 12c Enterprise Edition Release 1 for Windows, by visiting http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html.
- After the download, install Oracle 12c on your Windows computer. Make note of the passwords you specify for SYS and SYSTEM. Be sure to install the sample schemas when prompted during the database creation steps. You will be prompted for passwords for each sample schema. Make a note of the passwords, especially the password for "HR" as this is the schema we will focus on.
- Start "SQL Plus". SQL Plus is one of the icons under the Oracle 12c category on your Start Menu.
- You will be prompted for the user name. Enter
hrand hit Enter:
You will be prompted for the
hrpassword. Enter the password and hit Enter again.
- We will now explore the HR (Human Resources) sample schema.
- Type in the following SQL statement to view the tables in the HR schema:
- Let's select a sample employee and take a brief tour of some of the tables. Type in the following SQL statement and hit Enter:
department_idconnects the employee to a department.
- Let's get more data on the department:
location_idconnects the department to a location.
- With the
location_idwe can determine the location city and state or province:
country_idconnects the location to a country.
- We'll end our quick tour of the HR schema by using the
country_idto display country name: