Union Flashcards

1
Q

What does the UNION set operator do?

A

It appends tables together.

Last Revised: 4/2/21, 5.3

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

When using the UNION set operator, where does it go?

A

Between the two SELECT statements you would like to append.

Last Revised: 4/2/21, 5.6

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

What are the three requirements of the columns in the SELECT clauses in order for the UNION set operator to work?

A
  1. There must be the same number of columns
  2. The columns must be in the same order
  3. The columns must have similar data types, respectively

(Last Revised: 4/2/21, 5.7)

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

TRUE or FALSE: When using the UNION set operator, the resulting table uses the column names supplied in the second SELECT clause.

A

False
The resulting table uses the column names supplied in the first SELECT clause.

(Last Revised: 4/2/21, 5.8)

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

The UNION set operator returns only distinct values by default. How would you allow duplicate values?

A

By using UNION ALL

Last Revised: 4/2/21, 5.8

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