Explain various types of joins.Types of joins are:
- Equijoins - Non-equijoins - self join - outer joinWhat is a join, explain the types of joins?A Join is used to create query using two or more tables and views.
Types of JOIN are
- Inner - Outer (Left, Right and Full) - Cross
Inner Inner joins are also called as Equi join. They are the most common joins used in the SQL*PLUS. They are known as Equi Joins because the where clause generally compares two columns from the respective tables with the equivalence operator ‘=’. This is default join in many systems.
Outer Outer joins are similar to inner joins with a bit more flexibility while selecting data from the related tables. This type of joins are generally used in cases where it is desired, to select all rows from either table (left or right or both) regardless of whether the tables have values in common and usually enter NULL where data is missing.
Cross Cross Join returns something known as Cartesian’s Product. Cross join operation combines every row from left table with every row from right table. In some cases it creates havoc but used in perfect condition it is very useful. This type of join is used in very less cases as it may use long period of time and memory while operation.
|