SQL - SubqueriesWhich of the following best describes a correlated subquery?AA subquery that is executed only onceBA subquery that does not depend on the outer queryCA subquery that returns multiple rows without conditionsDA subquery that references columns from the outer queryCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify correlation in subqueriesA correlated subquery uses columns from the outer query in its WHERE or SELECT clause.Step 2: Differentiate from non-correlated subqueriesNon-correlated subqueries run independently without referencing outer query columns.Final Answer:A subquery that references columns from the outer query -> Option DQuick Check:Correlated subquery = references outer query columns [OK]Quick Trick: Correlation means subquery uses outer query columns [OK]Common Mistakes:MISTAKESConfusing correlation with subquery independenceAssuming all subqueries are correlatedIgnoring column references in subquery
Master "Subqueries" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Aggregate Functions - COUNT function behavior - Quiz 12easy GROUP BY and HAVING - GROUP BY single column - Quiz 4medium INNER JOIN - INNER JOIN syntax - Quiz 9hard INNER JOIN - INNER JOIN with ON condition - Quiz 4medium LEFT and RIGHT JOIN - LEFT JOIN vs RIGHT JOIN decision - Quiz 10hard Set Operations - EXCEPT (MINUS) for differences - Quiz 11easy Subqueries - Subquery with EXISTS operator - Quiz 10hard Table Constraints - Composite primary keys - Quiz 10hard Views - Updatable views and limitations - Quiz 14medium Views - Updatable views and limitations - Quiz 3easy