Joins · SQL SQL

What will be the behavior of a FULL OUTER JOIN between Table X and Table Y if there are rows in Table Y that do not match any rows in Table X?

Practice question from Joins (SQL SQL), with the correct answer and a step-by-step solution.

medium · MCQ · Q-A3C989

What will be the behavior of a FULL OUTER JOIN between Table X and Table Y if there are rows in Table Y that do not match any rows in Table X?

  1. A.Those rows from Table Y will be excluded from the final result set.
  2. B.Those rows from Table Y will be included, and columns from Table X for those rows will contain NULL values.Correct answer
  3. C.The query will throw a runtime error due to unmatched right-side data.
  4. D.Those rows from Table Y will be merged with the first row of Table X.

Solution

A FULL OUTER JOIN returns all records when there is a match in either left or right table records. If a row in the right table does not match the left table, the columns from the left table are filled with NULLs, and vice versa.

More from Joins

All of Joins

Practise more SQL

Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.

Start practising free

Free to start · No credit card needed