Which of the following is the correct syntax for a LEFT OUTER JOIN?
easy📝 Syntax Q12 of 15
SQL - LEFT and RIGHT JOIN
Which of the following is the correct syntax for a LEFT OUTER JOIN?
ASELECT * FROM table1 JOIN LEFT OUTER table2 ON table1.id = table2.id;
BSELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id;
CSELECT * FROM table1 OUTER LEFT JOIN table2 ON table1.id = table2.id;
DSELECT * FROM table1 LEFT OUTER JOIN table2 WHERE table1.id = table2.id;
Step-by-Step Solution
Solution:
Step 1: Recall correct LEFT OUTER JOIN syntax
The correct syntax is: SELECT ... FROM table1 LEFT JOIN table2 ON condition; LEFT JOIN is shorthand for LEFT OUTER JOIN.
Step 2: Identify syntax errors in other options
SELECT * FROM table1 JOIN LEFT OUTER table2 ON table1.id = table2.id; has JOIN LEFT OUTER which is invalid order. SELECT * FROM table1 OUTER LEFT JOIN table2 ON table1.id = table2.id; uses OUTER LEFT JOIN which is incorrect. SELECT * FROM table1 LEFT OUTER JOIN table2 WHERE table1.id = table2.id; uses WHERE instead of ON for join condition.
Final Answer:
SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id; -> Option B
Quick Check:
LEFT JOIN ... ON ... is correct syntax [OK]
Quick Trick:Use LEFT JOIN ... ON ... for correct outer join syntax [OK]
Common Mistakes:
MISTAKES
Swapping JOIN and LEFT keywords
Using WHERE instead of ON for join condition
Writing OUTER LEFT JOIN instead of LEFT OUTER JOIN
Master "LEFT and RIGHT JOIN" in SQL
9 interactive learning modes - each teaches the same concept differently