SQL - LEFT and RIGHT JOINWhat does a LEFT JOIN do in SQL?ADeletes rows from the left table that have no match in the right table.BKeeps only rows that have matches in both tables.CKeeps all rows from the right table and adds matching rows from the left table.DKeeps all rows from the left table and adds matching rows from the right table or NULL if no match.Check 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 with unmatched rowsIf there is no matching row in the right table, the result shows NULL for right table columns.Final Answer:Keeps all rows from the left table and adds matching rows from the right table or NULL if no match. -> Option DQuick Check:LEFT JOIN = all left rows kept [OK]Quick Trick: Remember: LEFT JOIN keeps all left rows, fills right with NULL if no match [OK]Common Mistakes:MISTAKESConfusing LEFT JOIN with INNER JOINThinking it keeps all right table rowsAssuming unmatched rows are dropped
Master "LEFT and RIGHT JOIN" in SQL9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More SQL Quizzes Advanced Joins - Joining more than two tables - Quiz 15hard Advanced Joins - Natural join and its risks - Quiz 2easy Aggregate Functions - AVG function - Quiz 2easy Aggregate Functions - SUM function - Quiz 15hard GROUP BY and HAVING - HAVING clause for filtering groups - Quiz 10hard Set Operations - UNION ALL with duplicates - Quiz 9hard Table Constraints - NOT NULL constraint - Quiz 15hard Table Relationships - Many-to-many with junction tables - Quiz 8hard Views - Why views are needed - Quiz 5medium Views - Views for security and abstraction - Quiz 4medium