Skip to content

adibbiniqbal/oracle-hr-sample-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Oracle HR Sample Schema for Oracle Database

Easily set up the official Oracle HR (Human Resources) sample schema in your Oracle database — perfect for learning, testing SQL queries, or demonstrating features.

This repo contains a set of SQL scripts designed to:

  • Create the HR user and schema
  • Set up all required tables
  • Populate the tables with sample data
  • Add indexes and comments

✅ Prerequisites


📦 How to Set Up the HR Schema

Follow these steps to create the HR sample schema in your Oracle pluggable database (PDB):

  1. Download the SQL files in this repository, using either the Git commands or manually downloading them (view file > raw > save as).
git clone https://github.com/adibbiniqbal/oracle-hr-sample-schema
  1. Open an IDE (e.g. Oracle SQL Developer) and connect to your container database.
  2. Login as SYS AS SYSDBA and run script 01, which creates the new HR user and grants the necessary privileges.
  3. Connect to the database as the new HR user.
  4. Run script 02 to create the tables.
  5. Run script 03 to populate the tables with sample data.
  6. Run script 04 to create indexes and add comments.

The schema is now set up!

🔐 Oracle HR User Login Details:

Username: HR
Password: hr
Host: localhost
Port: 1521
Service Name: orclpdb1

ERD

Here's the ERD of the HR schema used: ERD - Oracle HR Schema


📃 License

MIT License — feel free to use, modify, and contribute.


🙋 Support

If you have questions, open an issue or submit a pull request!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages