Courseiva

DA0-002 Data Concepts and Environments Practice Question

A data analyst is performing a join between two tables: 'employees' and 'departments'. The 'employees' table has a foreign key 'dept_id' referencing the 'departments' table. Which two join types would include all rows from the 'employees' table, regardless of whether there is a matching department? (Select TWO)

⚠ Common exam trap

DA0-002 often tests the confusion between LEFT JOIN and RIGHT JOIN — candidates forget that RIGHT JOIN preserves the right table, so it excludes employees without departments, and they may also mistakenly select CROSS JOIN thinking it 'includes everything.'

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

LEFT JOIN

A LEFT JOIN (option A) returns all rows from the left table (employees) plus matching rows from the right table (departments), so every employee appears even when dept_id has no matching department. A FULL OUTER JOIN (option E) returns all rows from both tables, which necessarily includes every row from employees regardless of a match, so it also satisfies the requirement. INNER JOIN (B) only returns rows where the join condition matches, dropping unmatched employees. CROSS JOIN (C) produces a Cartesian product with no join predicate, which is not a match-based join and does not preserve employee rows in the intended sense. RIGHT JOIN (D) preserves all rows from departments, not employees, so unmatched employees would be excluded.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    LEFT JOIN

    Why this is correct

    A LEFT JOIN preserves every row from the left table, employees, matching department columns where dept_id resolves and returning NULLs otherwise. This directly satisfies the requirement that all employee rows appear regardless of department match.

  • ✗

    INNER JOIN

    Why it's wrong here

    An INNER JOIN returns only rows where 'dept_id' matches a department key, silently discarding employees whose department is missing or NULL. It is the right choice when only fully matched pairs are wanted, but here it contradicts the requirement to retain every employee row.

  • ✗

    CROSS JOIN

    Why it's wrong here

    A CROSS JOIN produces the Cartesian product of both tables, pairing every employee with every department and multiplying row counts; it never preserves unmatched employees with NULL department columns. It is genuinely useful for generating all combinations, such as test matrices or date-to-product permutations, but it satisfies no requirement here.

  • ✗

    RIGHT JOIN

    Why it's wrong here

    A RIGHT JOIN preserves all rows from the right-hand 'departments' table, not 'employees', so unmatched departments survive while employees without a department are dropped. It is the correct choice when the right table must be fully retained, which is the opposite of this stem's requirement.

  • ✓

    FULL OUTER JOIN

    Why this is correct

    A FULL OUTER JOIN returns all rows from both tables, so every employee row appears whether or not a matching department exists. Unmatched employee rows surface with NULL department columns, satisfying the requirement to retain all employees.

About these practice questions

One of 1,004 original DA0-002 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This DA0-002 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DA0-002 exam.