To write a query that performs an outer join of tables A and B and returns all rows from B, You need to write

  1. any outer join

  2. a left outer join

  3. a cross join

  4. a right outer join


Correct Option: D

AI Explanation

To answer this question, you need to understand the concept of outer joins.

An outer join is used to combine records from two tables, even if there is no match between the columns being joined. There are three types of outer joins: left outer join, right outer join, and full outer join.

In this case, the question asks for a query that returns all rows from table B. To achieve this, you need to perform a right outer join.

Option A) Any outer join - This option is incorrect because it is too general and does not specify the type of outer join required.

Option B) Left outer join - This option is incorrect because a left outer join would return all rows from table A, not table B.

Option C) Cross join - This option is incorrect because a cross join returns the Cartesian product of the two tables, which is not what the question asks for.

Option D) Right outer join - This option is correct because a right outer join combines all rows from table B, even if there is no match in table A.

Therefore, the correct answer is D) a right outer join.

Find more quizzes: