Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Concatenation
5. Concatenation operator || continued
Simple text functions
How to modify strings
Review

Instruction

Good job! The concatenation operator is a very useful tool provided by the SQL standard. Mind you though, 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) AS 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. Name the column sentence.

Stuck? Here's a hint!

Use || as many as four times and remember about spaces and a period at the end. You can rename a column with the keyword AS