SQL - Set OperationsWhat does the SQL INTERSECT operator do?ACombines rows from both queries including duplicates.BReturns all rows from the first SELECT query.CReturns all rows from the second SELECT query.DReturns only the rows common to both SELECT queries.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand the purpose of INTERSECTThe INTERSECT operator compares two SELECT queries and returns only the rows that appear in both results.Step 2: Compare with other set operatorsUnlike UNION or UNION ALL, INTERSECT excludes rows not common to both queries.Final Answer:Returns only the rows common to both SELECT queries. -> Option DQuick Check:INTERSECT = common rows [OK]Quick Trick: INTERSECT keeps only shared rows between two queries [OK]Common Mistakes:MISTAKESConfusing INTERSECT with UNION which combines all rowsThinking INTERSECT returns rows from only one queryAssuming INTERSECT includes duplicates
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