SQL Join is the method for fetching records from more than one table at the same time. In SQL world, we often store different type of data in several tables. And most of the time we may come across situation to retrieve rows from several table in order to make result set more meaningful. In such cases, we will use SQL Join to retrieve data from several tables. For SQL Join , we need at least one matching column in both the tables participating in SQL Join. SQL Joins are of several types:
SQL INNER JOIN: This type of SQL Join is used to fetch matching records from both the tables participating in join. We use this type of join when we need values for all the columns we are selecting in SELECT clause.
SQL OUTER JOIN: This type of SQL Join is used to fetch records from several tables where record from one table is must required even if it is not having any matching records in other table.
SQL CROSS JOIN: This type of SQL Join is used to fetch all the records from both the tables participating in SQL Join. In this type of SQL Join, we need not specify any joining condition. Hence, all the records of one table is matched to all the records of other table.
SQL SELF JOIN: This type of SQL JOIN is used when we need to match record of a table with records of the same table. This means that the table is joined to itself. In this type of SQL Join we have to specify the condition on which table records will be joined to itself.