TDA-C01 practice question 4 of 25

You have two tables named Employeelnfo and DepartmentInfo. Employeelnfo contains four fields named Full Name, Department ID, Start Date, and Salary…

Full set: 117 questions
You have two tables named Employeelnfo and DepartmentInfo. Employeelnfo contains four fields named Full Name, Department ID, Start Date, and Salary. DepartmentInfo contains four fields named Department Name, Size, Department ID, and VP. You want to combine the tables to meet the following requirements: . Each record in Employeelnfo must be retained in the combined table. . The records must contain the Department Name, Size, and VP fields. · Every record must have a full name. Which type of join should you use?
Answer options
A: Inner
B: Left Correct answer
C: Full outer
D: Union
Correct Answer:
B. Left
Explanation

A left join is the correct choice because it fulfills the primary requirement to retain all records from the EmployeeInfo table. This join type starts with the left table (EmployeeInfo) and brings in matching records from the right table (DepartmentInfo) based on the common Department ID field. If an employee record in EmployeeInfo has a Department ID that does not exist in DepartmentInfo, the employee record is still included in the final dataset, but the fields from DepartmentInfo (Department Name, Size, VP) will be null. This ensures every record has a full name and all employee records are kept.

Why Incorrect

A. Inner: An inner join would only keep records where the Department ID exists in both tables, failing to retain all records from EmployeeInfo.
C. Full outer: A full outer join would include all departments, even those without any employees listed in EmployeeInfo, which is more than the requirements specify.
D. Union: A union appends rows from tables with identical column structures; it cannot be used to combine columns from tables with different structures as required here. ---

References

1. Tableau Help. (n.d.). Join Your Data. Tableau Software.

Section: "Join types"

Content: This official documentation explicitly defines a left join as a type that "contains all values from the left table and corresponding matches from the right table." It clarifies that when a match is not found

null values are used for the fields from the right table

which directly supports the chosen answer.

2. Duke University Libraries. (n.d.). Tableau: Joining & Blending Data.

Section: "Types of Joins"

Content: This university guide states

"A left join will keep everything from the 'left' table

and add information from the 'right' table where it matches." This aligns perfectly with the requirement to retain all records from the EmployeeInfo table.

3. Tableau Knowledge Base. (n.d.). Combining Multiple Tables with the Same Structure. Tableau Software.

Section: "Environment" and "Resolution"

Content: This article clarifies that a union is the method for appending rows from tables that share the same column structure. This confirms that a union is inappropriate for the scenario described

which involves combining tables with different columns based on a key.

Scroll to Top