Beginner

94. String Concatenation

Learn how to combine multiple text values into a single string.

📘 Lesson 94 of 728 ⏱ 8 min 🎯 Beginner

String concatenation means combining two or more text values into one result. SQL databases provide different concatenation operators or functions depending on the database system.

Business data is often stored across multiple columns. Analysts may need to combine first and last names, addresses, codes, or other text values into a single output.

If FirstName and LastName are stored separately, they can be combined to display a complete employee name.

SQL
SELECT
    CONCAT(FirstName, ' ', LastName) AS FullName
FROM Employees;

Concatenation is useful for customer names, employee names, addresses, labels, identifiers, report fields, and formatted output.

  • Concatenation combines text values.
  • CONCAT is supported by many SQL systems.
  • Different databases may use different concatenation syntax.
  • Concatenation is useful for report formatting.
  • NULL behavior can vary depending on the function and database.
What is string concatenation?

String concatenation is the process of combining multiple text values into one string.

How can CONCAT be used?

CONCAT can combine values such as first name and last name into a single text result.

Have you finished this lesson?

Introduction to SQL – All Lessons