Introduction
Concatenation
5. Concatenation operator || continued
Simple text functions
How to modify strings
Revision

Instruction

Good job! The concatenation operator is a very useful tool provided by the SQL standard. Mind you, though, that there are a few databases that don't comply with the standard in this regard. For example:

  • SQL Server and Microsoft Access use the plus sign (+) as the concatenation operator.
  • MySQL uses the function concat() like this:
    SELECT CONCAT(first_name,' ',last_name)
    FROM copywriter;

Now that you've been officially warned, we can go back to || and do one more exercise.

Exercise

For each item, show the following sentence: 'ID X is Y.', where X is the id of the item and Y is its name.

Stuck? Here's a hint!

Use || as many as four times and remember about spaces and a full stop at the end.

Console

Code editor

Result

TableConsole