SQL Exp 05PK
SQL Exp 05PK
-05
Roll No. :- 34
Class:- SE (IT)
Subject:- DB (SQL)
Theory:
• The relation operation can merge columns from two different tables to form new Join
table.
• We can join multiple tables with the help of same join condition without any join
condition.
• Different types of gain:
(i) Inner Join
(ii) Natural Join
(iii) Outer join - (a) left outer join
(b) right outer join
(c) full outer join
(iv) Self join
(v) Equi Join
(vi) Cross Join
(i)Inner join:
An inner join perform relational product between two table first and then use join condition
to select any only tuples satisfying join operation. Inner join will only merge tuple of merged
tuples satisfy join condition. Hence, it is called Inner Join.
(ii)Natural Join:
A natural join will select all types from both participating tables if and only if both has one
common column with same attribute. In this type of join, joining table must have atleast one
common column between them which has same column name and data type.
1) Left Outer Join:
4) Equi Join:
5) Cross Join:
d) Self Join:
A self join will work exactly same as inner join but there is only one participating table and
both column involved in joining are in same table. Table being joined in a query do not need
to be distinct you can join any table to itself.
f) Equi Join: It joins the table based on join condition specified in query. The result set
contains records that having same values In both tables.
g) Cross Join: A cross join performs relational product or cartesian product of two tables in
such product every tuple of first table is joined with each type in second table without any
join condition. In DBMS, cross join occurs due to missing where condition, in query or some
invalid operation in where classes.
Conclusion:
The jo in operation are used in Retrive data from multiple table. The Respective join
operation is performed based on join type and join conditions provided in query.