Bird
0
0

Identify the error in this query:

medium📝 Debug Q6 of 15
SQL - LEFT and RIGHT JOIN
Identify the error in this query:
SELECT * FROM Products LEFT JOIN Categories WHERE Products.cat_id = Categories.id;
ALEFT JOIN cannot be used without WHERE clause.
BMissing ON keyword before join condition.
CTable names are incorrect.
DJOIN condition should be in WHERE clause.
Step-by-Step Solution
Solution:
  1. Step 1: Check JOIN syntax

    JOIN conditions must be specified after ON keyword, not in WHERE clause.
  2. Step 2: Identify missing ON keyword

    The query uses WHERE instead of ON for join condition, causing syntax error.
  3. Final Answer:

    Missing ON keyword before join condition. -> Option B
  4. Quick Check:

    JOIN syntax error = A [OK]
Quick Trick: JOIN conditions go after ON, not in WHERE [OK]
Common Mistakes:
MISTAKES
  • Using WHERE instead of ON for join condition
  • Omitting ON keyword
  • Placing join condition in WHERE causing errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes