SQL INTERVIEW QUESTION & ANSWERS
66. |
What is inner join? |
|
INNER JOIN joins two or more tables and returns only those rows from the tables that follow the join condition. |
67. |
What is outer join? |
|
The OUTER JOIN returns all rows of a table with only those rows from another table that follow the join condition. It also returns a null value in place of the records which do not follow the join condition from the another table. |
68. |
What is left outer join? |
|
The LEFT OUTER JOIN returns all rows of the first table (the table that appears first in the table list of the FROM clause) and only those rows from the second table that follow the join condition. It also returns replacement of the non-matching (that does not follow the join condition) rows from the second table with a NULL value. |
69. |
What is right outer join? |
|
The RIGHT OUTER JOIN returns all rows of the second table (that appears second in the table list of the FROM clause) and only those rows from the first table that follow the join condition. It also returns the replacement of the non-matching rows (rows that do not follow the join condition) from the first table with a NULL value.
|
70. |
What is anti join? |
|
An antijoin between two tables returns those rows from the first table for which there are no corresponding rows in the second table. It implies that antijoin returns the rows that fail to match the rows returned by the subquery on the right side. Antijoins are written using the NOT EXISTS or NOT IN operator.
|