24.1k views
5 votes
​A(n) ____________________ outer join is necessary when you need rows returned from either table that do not have a matching record in the other table.

A) INNER
B) CROSS
C) LEFT
D) RIGHT

1 Answer

4 votes

Final answer:

A LEFT or RIGHT outer join is necessary to return rows from either table that do not have a matching record in the other table. These joins are useful when one wants to include all the data from one side of the relationship, regardless of whether there's a match on the other side.

Step-by-step explanation:

A LEFT or RIGHT outer join is necessary when you need rows returned from either table that do not have a matching record in the other table. These types of joins are used to combine records from two tables and to include all records from one table and only those records from the second table where a specified condition is met. If the data doesn't match the condition, NULL values are returned for the columns of the table that lacks a matching record.

For example, if we have two tables, Table A and Table B, and we want to see all rows from Table A that do not have corresponding rows in Table B, we would use a LEFT outer join. Conversely, a RIGHT outer join is used to return all rows from Table B that have no corresponding rows in Table A.

It's important to clarify that neither LEFT nor RIGHT joins would include unmatched rows from both tables simultaneously. To retrieve all rows from both tables that do not have a match in the other, a different type of join called a FULL outer join would be used.

User Mstrom
by
8.8k points