
Answer-first summary for fast verification
Answer: SELECT customer_id, first_name + ' ' + last_name AS full_name FROM customer_table
Option B is the correct T-SQL query to achieve the desired transformation. In T-SQL, the '+' operator is used to concatenate strings. By using the query 'SELECT customer_id, first_name + ' ' + last_name AS full_name FROM customer_table', you can create a new table with the customer_id and full_name columns, where full_name is a concatenation of first_name and last_name with a space in between.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are working with Azure Synapse Analytics and need to transform data using Transact-SQL (T-SQL). You have a table with customer information, including customer_id, first_name, last_name, and email_address. You need to create a new table that contains only the customer_id and full_name columns, where full_name is a concatenation of first_name and last_name. Which T-SQL query would you use to achieve this?
A
SELECT customer_id, CONCAT(first_name, last_name) AS full_name FROM customer_table
B
SELECT customer_id, first_name + ' ' + last_name AS full_name FROM customer_table
C
SELECT customer_id, STRING_AGG(first_name, last_name, ' ') AS full_name FROM customer_table
D
SELECT customer_id, first_name || ' ' || last_name AS full_name FROM customer_table
No comments yet.