SQL - Set OperationsWhy does the SQL INTERSECT operator require the same number and order of columns in both SELECT statements?ABecause INTERSECT only works with numeric columnsBBecause INTERSECT automatically rearranges columns internallyCBecause INTERSECT compares rows column by column to find exact matchesDBecause INTERSECT ignores column order and numberCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand how INTERSECT compares rowsINTERSECT compares each row from both queries column by column to find exact matches.Step 2: Explain requirement for matching columnsSame number and order of columns ensure correct comparison of corresponding values.Final Answer:Because INTERSECT compares rows column by column to find exact matches -> Option CQuick Check:INTERSECT needs matching columns for row comparison [OK]Quick Trick: INTERSECT compares rows column-wise, so columns must match [OK]Common Mistakes:MISTAKESThinking INTERSECT works only on numeric columnsAssuming INTERSECT rearranges columns automaticallyBelieving column order does not matter
Master "Set Operations" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Advanced Joins - Self join for hierarchical data - Quiz 5medium Aggregate Functions - Combining multiple aggregates - Quiz 2easy Aggregate Functions - SUM function - Quiz 14medium GROUP BY and HAVING - HAVING clause for filtering groups - Quiz 5medium INNER JOIN - Self join concept - Quiz 11easy Set Operations - UNION ALL with duplicates - Quiz 4medium Set Operations - Set operations with ORDER BY - Quiz 8hard Subqueries - Scalar subquery in SELECT - Quiz 8hard Views - Updatable views and limitations - Quiz 1easy Views - CREATE VIEW syntax - Quiz 3easy