Bird
0
0

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:
  1. 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.
  2. 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.
  3. Final Answer:

    SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id; -> Option B
  4. 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

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes