Tables used in SQL JOIN tutorial.

By Manish Sharma

Tables used in my JOIN tutorial series.

In order to make the concept of SQL join easy to understand I have created and populated two very simple tables.

Table 1: EMP this is a very simple table which consists of 3 columns emp id, emp name and emp salary where column emp id is the primary key.

The query to create this table is

    emp_id    NUMBER(2)   CONSTRAINT   emp_col1_pk   PRIMARY KEY,
    emp_name   VARCHAR2(20),
    emp_salary   NUMBER(5)

Table 2: The second table is DEPT this table also consists of 3 columns dept id, dept name and emp id. Column dept id is the primary key here and column emp id is the foreign key reference from the emp table.

The query to create this table is

    dept_id    NUMBER(2)   CONSTRAINT   emp_col1_pk   PRIMARY KEY,
    dept_name   VARCHAR2(20),
    emp_id  CONSTRAINT   dept_col3_fk   REFERENCES   emp(emp_id)

Data in the table.

You can insert whatever data you want in these tables but for the demonstration of the SQL join I have inserted 5 rows in each table.

I am providing you the SQL script where you can find the query for Table Creation and Data insertion.

SQL Script and Presentation used

You can DOWNLOAD SQL script and presentation used in the Video and in this article.

SQL Script used in Video and in this article

I have used copy cloud to share these resourses. You can also join copy cloud and get 15GB free cloud storage for lifetime. If you will use this referal link You will get 5GB extra free cloud storage means total 20GB free cloud storage.

  • Manish Sharma Oracle certified SQL expert
  • Manish Sharma oracle certified associate
  • Manish Sharma oracle certified professional
  • View Manish Sharma's profile on LinkedIn
  •          View Manish Sharma's profile on LinkedIn