Question

    Which type of join retrieves records from two tables where

    there is no matching entry in the second table?
    A Inner Join Correct Answer Incorrect Answer
    B Full Outer Join Correct Answer Incorrect Answer
    C Left Outer Join Correct Answer Incorrect Answer
    D Right Outer Join Correct Answer Incorrect Answer
    E Cross Join Correct Answer Incorrect Answer

    Solution

    A Left Outer Join retrieves all records from the first (left) table and the matching records from the second (right) table. If there are no matches, the result will include NULL values for columns from the second table. For instance, in a join between "employees" and "departments," if an employee doesn’t belong to any department, their record will still appear in the output, with department details as NULL. Why Other Options Are Incorrect:

    • Inner Join: Only retrieves matching records from both tables, excluding unmatched entries.
    • Full Outer Join: Includes all records from both tables, with NULLs for non-matching entries from either side.
    • Right Outer Join: Retrieves all records from the second (right) table and matches from the first.
    • Cross Join: Produces a Cartesian product, pairing all rows in the first table with all rows in the second, regardless of matching conditions.

    Practice Next