DA0-002 practice question 20 of 25

[Data Acquisition and Preparation]Given the following tables: Individual table ID FirstName LastName 1 John Doe Output ID FullName 1 JohnDoe Which of…

Full set: 111 questions

[Data Acquisition and Preparation]

Given the following tables: Individual table ID FirstName LastName 1 John Doe Output ID FullName 1 JohnDoe Which of the following is the best option to display output from FirstName and LastName as FullName?

Answer options
A: Concatenate Correct answer
B: Filter
C: Join
D: Group
Correct Answer:
A. Concatenate
Explanation

The task is to combine the string values from two separate columns, FirstName and LastName, into a single column, FullName. The operation that joins two or more strings end-to-end is called concatenation. In database languages like SQL, this is commonly performed using a CONCAT function or a concatenation operator (e.g., || or +). This operation directly transforms "John" and "Doe" into the required "JohnDoe" format, making it the most appropriate choice for this data preparation task.

Why Incorrect

B. Filter: Filtering is used to select a subset of rows from a table based on specified criteria; it does not combine column values.
C. Join: A join is used to combine rows from two or more tables based on a related column, not to merge data from columns within the same table.
D. Group: Grouping is used with aggregate functions to summarize multiple rows into a single summary row; it does not merge string values. ---

References

1. Microsoft SQL Server Documentation. The official documentation for the CONCAT function in Transact-SQL explicitly defines its purpose.

Source: Microsoft. (n.d.). CONCAT (Transact-SQL). SQL Server Documentation.

Reference: In the "Arguments" and "Return Types" sections

it is stated that the function takes two or more string values as input and "returns a string that is the result of concatenating" them.

2. PostgreSQL Documentation. The official PostgreSQL documentation details standard string functions and operators for data manipulation.

Source: The PostgreSQL Global Development Group. (2023). PostgreSQL 16 Documentation.

Reference: Chapter 9

Section 9.4

"String Functions and Operators." This section describes the string concatenation operator || as the standard way to "concatenate the two strings."

3. University Courseware. Reputable university database courses cover fundamental data manipulation operations

including string concatenation.

Source: University of California

Berkeley. (Fall 2022). CS 186: Introduction to Database Systems

Lecture 2: Advanced SQL.

Reference: Slide 4

"String Operations

" explicitly lists "Concatenation (using ||)" as a primary string operation in SQL for combining string values.

Scroll to Top