Concatenation Flashcards

1
Q

What does concatenation mean?

A

Concatenation means joining two or more strings together to create a single string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens if you try to concatenate a string with a null value?

A

The entire expression will evaluate to NULL.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the two ways to concatenate expressions?

A
  • Use the plus sign (+)
  • Use the CONCAT() function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens if you try to concatenate a string with a number datatype?

A

An error will be generated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the benefits of using the CONCAT() function over the other method?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Using the plus sign, do you add apostrophes to numbers or to strings?

A

You would need to add apostrophes to numbers when using the plus sign concatenation technique.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What goes inside the CONCAT() function?

A

You can add the different columns data you want to join together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly