SQL Joins | Oracle SQL joins example

JOINS:

1. The purpose of a join is to combine the data across tables.
2. A join is actually performed by the where clause which combines the specified rows of tables.
3. If a join involves in more than two tables then Oracle joins first two tables based on the joins condition and then compares the result with the next table and so on.

SQL> select * from dept;

DEPTNO
DNAME
LOC
10
INVENTORY
HYBD
20
FINANCE
BGLR
30
HR
MUMBAI

SQL> select * from emp;

EMPNO
ENAME
JOB
MGR
DEPTNO
111
saketh
analyst
444
10
222
sudha
clerk
333
20
333
jagan
manager
111
10
444
madhu
engineer
222
40


Types of Joins:

      1     Equi join
      2     Non-equi join
      3     Self join
      4     Natural join
      5     Cross join
      6     Outer join 
              • Left outer 
              • Right outer 
              • Full outer 
      7     Inner join
      8     Using clause
      9     On clause