88.1k views
4 votes
The following is an outer join:

SELECT *
FROM Person
JOIN Company ON Person.ID = Company.contactID A. True B.False

1 Answer

6 votes

Final answer:

The provided SQL query is not an outer join; it's an inner join because it lacks LEFT, RIGHT, or FULL keywords. An outer join includes unmatched rows from the tables, which is not indicated in the provided query.

Step-by-step explanation:

The SQL query provided is not an outer join; it is a simple or inner join. An outer join is used to include rows that do not have matching entries in both tables. There are three types of outer joins: LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN. The keywords LEFT, RIGHT, or FULL specify the type of outer join being used. The presence of these keywords determines whether unmatched rows from one or both tables will be included in the result set.The query provided does not contain any of these specifies, therefore it defaults as an inner join which only returns rows where there is a match in both the Person and Company tables based on the condition specified (Person.ID = Company.contactID).

The given SQL query is asking whether the statement SELECT * is an outer join.The correct answer is B. False.In anouter join, all the rows from at least one of the tables are included in the result set, even if there is no match between the columns being joined.However, the given query is not an outer join. It is an inner join because it uses the keyword JOIN without specifying whether it is a LEFT JOIN, RIGHT JOIN, or FULL JOIN.In an inner join, only the rows that have matching values in both tables are included in the result set.In order to make it an outer join query, you would need to add LEFT, RIGHT, or FULL before the JOIN keyword based on your data retrieval requirements.

User John Sonmez
by
8.4k points