Bird
0
0

Why does a LEFT JOIN sometimes behave like an INNER JOIN when a WHERE clause filters on the right table columns?

hard📝 Conceptual Q10 of 15
SQL - LEFT and RIGHT JOIN
Why does a LEFT JOIN sometimes behave like an INNER JOIN when a WHERE clause filters on the right table columns?
ABecause LEFT JOIN automatically converts to INNER JOIN with WHERE
BBecause the WHERE clause excludes rows where right table columns are NULL
CBecause ON clause is ignored when WHERE is present
DBecause LEFT JOIN only preserves rows with matching right table rows
Step-by-Step Solution
Solution:
  1. Step 1: Understand LEFT JOIN and NULLs

    LEFT JOIN includes all left rows; unmatched right rows have NULLs in right columns.
  2. Step 2: Effect of WHERE on right table columns

    WHERE filters out rows where right columns are NULL, removing unmatched left rows.
  3. Final Answer:

    Because the WHERE clause excludes rows where right table columns are NULL -> Option B
  4. Quick Check:

    WHERE on right columns can turn LEFT JOIN into INNER JOIN effect [OK]
Quick Trick: WHERE on right table columns removes NULLs, mimicking INNER JOIN [OK]
Common Mistakes:
MISTAKES
  • Thinking LEFT JOIN changes to INNER JOIN automatically
  • Ignoring filtering effect of WHERE on NULLs
  • Assuming ON clause is ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes