DA0-001 · Question #348
A data analyst has been asked to create one table that has each employee's first name, last name, sales, and address. The sales and addresses are listed in the tables below: Which of the following…
The correct answer is D. Create a column that concatenates the first name and last name in each table. Use concatenate. To accurately combine employee data from two tables where first and last names are separate, concatenating them into a full name in each table creates a unique identifier suitable for a lookup or join operation. This ensures correct matching of sales and address information to…
Question
A data analyst has been asked to create one table that has each employee's first name, last name, sales, and address. The sales and addresses are listed in the tables below:
Which of the following steps should the analyst take to create the table?
Exhibit
Options
- ATranspose the first name and last name in both tables. Use lookup to pull the address field from
- BUse lookup with the first name or first name to pull the address field from Table 2 into Table 1.
- CUse the append formula in both tables for the first name and last name. Use lookup to pull the
- DCreate a column that concatenates the first name and last name in each table. Use concatenate
How the community answered
(56 responses)- A2% (1)
- B9% (5)
- C5% (3)
- D84% (47)
Why each option
To accurately combine employee data from two tables where first and last names are separate, concatenating them into a full name in each table creates a unique identifier suitable for a lookup or join operation. This ensures correct matching of sales and address information to the right employee.
Transposing first and last names changes their orientation, which is not relevant for combining data based on matching employee records.
Using lookup with only the first name or only the last name is risky and can lead to incorrect matches if multiple employees share the same first or last name.
Appending first names and last names into existing columns in both tables does not create a single, reliable join key and is not a standard way to combine related data from separate tables.
Creating a concatenated column of first name and last name in each table establishes a unique identifier for each employee. This composite key can then be used in a lookup or join operation to accurately combine sales and address information from different tables into a single comprehensive table.
Concept tested: Data manipulation, data joining, unique identifiers, concatenation
Source: https://learn.microsoft.com/en-us/sql/t-sql/functions/concat-transact-sql
Topics
Community Discussion
No community discussion yet for this question.
