Which statement is true regarding the INTERSECT operator?

  1. It ignores NULL values

  2. Reversing the order of the intersected tables alters the result.

  3. The names of columns in all SELECT statements must be identical.

  4. The number of columns and data types must be identical for all SELECT statements in the


Correct Option: D

AI Explanation

To answer this question, you need to understand the INTERSECT operator in SQL, which is used to combine the result sets of two or more SELECT statements.

Let's go through each option to understand why it is correct or incorrect:

Option A) It ignores NULL values - This option is incorrect. The INTERSECT operator considers NULL values when comparing the results of the SELECT statements.

Option B) Reversing the order of the intersected tables alters the result - This option is incorrect. The order of the intersected tables does not affect the result of the INTERSECT operation.

Option C) The names of columns in all SELECT statements must be identical - This option is incorrect. The INTERSECT operator does not require the column names to be identical. It only requires that the number of columns and their data types are identical in all the SELECT statements.

Option D) The number of columns and data types must be identical for all SELECT statements - This option is correct. The INTERSECT operator requires that the number of columns and their data types are identical in all the SELECT statements. If the number of columns or their data types differ, an error will occur.

The correct answer is Option D. This option is correct because the number of columns and data types must be identical for all SELECT statements in the INTERSECT operation.

Find more quizzes: