DA0-002 · Question #59
Given the following tables: Which of the following is the best option to display output from FirstName and LastName as FullName?
The correct answer is A. Concatenate. To combine the 'FirstName' and 'LastName' columns into a single 'FullName' output, the best option is to concatenate them.
Question
Given the following tables:
Which of the following is the best option to display output from FirstName and LastName as FullName?
Options
- AConcatenate
- BFilter
- CJoin
- DGroup
How the community answered
(43 responses)- A91% (39)
- B2% (1)
- C5% (2)
- D2% (1)
Why each option
To combine the 'FirstName' and 'LastName' columns into a single 'FullName' output, the best option is to concatenate them.
Concatenation is the process of joining two or more strings or text values end-to-end to form a single string. In SQL, this is typically done using operators like '+' or '||', or functions like CONCAT(), to combine FirstName and LastName into a FullName.
Filtering is used to select rows based on specified criteria, not to combine data from different columns into a new one.
Joining is used to combine columns from two or more tables based on a related column, which is not applicable for combining columns within the same table.
Grouping is used to aggregate data and perform calculations on sets of rows, not to merge text from individual columns into a new single column.
Concept tested: SQL string 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.