N/APosted on - 06/06/2012
Please list the types of Joins that are used in SQL, Oracle and MYSQL and their advantages and uses. I would also like to know in detail about a scenario in which Right and Left joins are used in the same query.
Is it possible?
Types of Joins that are used in SQL?
There are three types of joins in SQL, ORACLE and MYSQL:
1. Inner Join
In Inner Join two tables are joined together only if they have at least one common column
2. Outer Join
In Outer Join two tables are joined together irrespective of the fact whether they have common column or not Outer join is classified in three categories:
Left Outer Join
The Left Outer Join returns all rows from the left table in query, even if there are no matches in the right table
Right Outer Join
The Right Outer Join all the rows from the right table in the query , even if there are no matches in the left table
Full Outer Join
The Full Outer Join return rows when there is a match in one of the tables
3. Self Join
In self join a table is joined to itself