Concatenation Flashcards
What does concatenation mean?
Concatenation means joining two or more strings together to create a single string.
What happens if you try to concatenate a string with a null value?
The entire expression will evaluate to NULL.
What are the two ways to concatenate expressions?
- Use the plus sign (+)
- Use the CONCAT() function
What happens if you try to concatenate a string with a number datatype?
An error will be generated
What are the benefits of using the CONCAT() function over the other method?
You can concatenate numbers and strings because it converts numbers into a string format.
Results won’t return NULL even if the column has NULL values. This is because NULL is converted to an empty string with the CONCAT function.
Using the plus sign, do you add apostrophes to numbers or to strings?
You would need to add apostrophes to numbers when using the plus sign concatenation technique.
What goes inside the CONCAT() function?
You can add the different columns data you want to join together.