Which statement best describes an outer join?

Prepare for the FAST Enterprises IC Interview. Enhance your skills with flashcards and multiple-choice questions. Each question provides hints and detailed explanations. Excel in your interview!

Multiple Choice

Which statement best describes an outer join?

Explanation:
Outer joins preserve rows from one table while bringing in matching rows from the other, and fill in NULLs when there is no match. The statement describes keeping all rows from one side and only the matching rows from the other, with NULLs for the non-matching side. That is exactly how a left outer join (or, symmetrically, a right outer join if you preserve the other table) works: you keep every row from the preserved table and attach matching rows from the joined table, or NULLs when there are none. For example, a left outer join from customers to orders on customer_id returns every customer, with their orders where they exist, and NULLs for customers without orders. In contrast, including all rows from both tables would describe a full outer join, and including only rows with matches in both tables would describe an inner join.

Outer joins preserve rows from one table while bringing in matching rows from the other, and fill in NULLs when there is no match. The statement describes keeping all rows from one side and only the matching rows from the other, with NULLs for the non-matching side. That is exactly how a left outer join (or, symmetrically, a right outer join if you preserve the other table) works: you keep every row from the preserved table and attach matching rows from the joined table, or NULLs when there are none. For example, a left outer join from customers to orders on customer_id returns every customer, with their orders where they exist, and NULLs for customers without orders. In contrast, including all rows from both tables would describe a full outer join, and including only rows with matches in both tables would describe an inner join.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy