SQL - Set OperationsWhich SQL clause is used to retrieve only the rows that exist in both of two SELECT query results?AINTERSECTBUNIONCJOINDEXCEPTCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify the purposeThe question asks for rows common to both SELECT queries.Step 2: Recall SQL set operatorsINTERSECT returns common rows, UNION combines all rows, JOIN combines rows based on keys, EXCEPT returns rows in first query not in second.Final Answer:INTERSECT -> Option AQuick Check:INTERSECT finds common rows [OK]Quick Trick: Use INTERSECT to get common rows from two queries [OK]Common Mistakes:MISTAKESChoosing UNION which merges all rowsConfusing JOIN with INTERSECTUsing EXCEPT which excludes rows
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