String Concatenation
Predict Output Easy
Question
What does this SQL produce?
Code
-- user: first="Ada", last="Lovelace"
SELECT first || " " || last FROM users;
Hint
|| concatenates strings (PostgreSQL/SQLite).
Explanation
The || operator concatenates strings in PostgreSQL and SQLite. first || " " || last produces "Ada" + " " + "Lovelace" = "Ada Lovelace". In MySQL, use CONCAT(first, " ", last). In SQL Server, use first + " " + last.
Related Resources
Related Lessons
- SQL Basics
Learn SQL.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.