Explanation: Answer option D is correct.
Self join is used to join a table to itself. Each row of the table is joined to itself and to every other row of the table. The table name appears twice in the FROM clause, with two different aliases. The two aliases are treated as two different tables, and they are joined to each other using the equality operator (=).
Answer option B is incorrect. Equijoin joins two tables using the equality operator (=). It returns only matched rows from both the tables.
Answer option C is incorrect. Cross join produces a result set of all possible combinations of rows of the joined tables.
Answer option A is incorrect. An outer join returns all rows that satisfy the join condition. It also returns some or all of those rows from one table for which no rows from the other satisfy the join condition.
There are three types of Outer Join:
LEFT OUTER JOIN: It returns all the rows from the left table in conjunction with the matching rows from the right table. If there are no columns matching in the right table, it will return NULL values.
SELECT * FROM Table1
LEFT OUTER JOIN Table2
ON Table1.Column1=Table2.Column1;
RIGHT OUTER JOIN: It returns all the rows from the right table in conjunction with the matching rows from the left table. If there are no columns matching in the left table, it will return NULL values.
SELECT * FROM Table1
RIGHT OUTER JOIN Table2
ON Table1.Column1=Table2.Column1;
FULL OUTER JOIN: It combines left outer join and right outer join. It returns row from either table when the conditions are met and returns null value when there is no match in both table.
SELECT * FROM Table1
FULL OUTER JOIN Table2
ON Table1.Column1=Table2.Column1;