SQL - LEFT and RIGHT JOINWhat does a LEFT JOIN do in SQL?AReturns only rows that have matching values in both tablesBReturns all rows from the left table and matching rows from the right table, NULL if no matchCReturns all rows from the right table and matching rows from the left tableDReturns rows only from the left table without any matchingCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand LEFT JOIN behaviorA LEFT JOIN returns all rows from the left table regardless of matches in the right table.Step 2: Check what happens when no match existsIf no matching row exists in the right table, the result shows NULL for right table columns.Final Answer:Returns all rows from the left table and matching rows from the right table, NULL if no match -> Option BQuick Check:LEFT JOIN = all left rows + matched right rows [OK]Quick Trick: LEFT JOIN keeps all left rows, fills right with NULL if no match [OK]Common Mistakes:MISTAKESConfusing LEFT JOIN with INNER JOINThinking LEFT JOIN returns only matching rowsAssuming NULLs never appear in results
Master "LEFT and RIGHT JOIN" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Aggregate Functions - COUNT function behavior - Quiz 10hard GROUP BY and HAVING - HAVING clause for filtering groups - Quiz 14medium GROUP BY and HAVING - GROUP BY with NULL values behavior - Quiz 14medium INNER JOIN - Why joins are needed - Quiz 8hard Set Operations - INTERSECT for common rows - Quiz 11easy Set Operations - EXCEPT (MINUS) for differences - Quiz 2easy Subqueries - Subquery with IN operator - Quiz 8hard Subqueries - Nested subqueries - Quiz 1easy Table Relationships - ER diagram to table mapping - Quiz 1easy Table Relationships - One-to-many relationship design - Quiz 10hard