Viewing and Exploring HR Schema Objects in Oracle 12c
In previous tutorial you have gone through following tutorials:
Installation of Oracle 12c
In this tutorial you will get to learn more about HR schema and its objects in Oracle 12c.
Listing the tables in HR schema
Run below command to see the tables in HR schema.
SELECT DISTINCT OBJECT_NAME FROM USER_OBJECTS WHERE OBJECT_TYPE = 'TABLE';
LOCATIONS EMPLOYEES REGIONS JOBS COUNTRIES JOB_HISTORY DEPARTMENTS
Listing all database Objects of HR schema in Oracle 12c
Below query will list all the database objects available HR schema.
SELECT OBJECT_NAME, OBJECT_TYPE FROM USER_OBJECTS ORDER BY OBJECT_TYPE, OBJECT_NAME;
Viewing EMPLOYEES Table properties in SQL Developer
Below query will be used to describe the structure of Employees table.
In same way you can see other Table properties also.
Selecting data from EMPLOYEES Table in SQL Developer
Below query will retrieve First Name, Phone Number and Salary from the Employees table and order it First Name.
SELECT FIRST_NAME, PHONE_NUMBER, SALARY FROM EMPLOYEES ORDER BY FIRST_NAME;
Same way you can select data for other tables.
Counting Total number of records from a Table
Use following query to count the number of rows in a table.
SQL> select count(*) from DEPARTMENTS;
In the same way you can count the number of rows in other Tables.
In next Tutorial you will learn more about Select queries in Oracle 12c.