Bird
0
0

Identify the error in this SQL query:

medium📝 Debug Q14 of 15
SQL - INNER JOIN
Identify the error in this SQL query:
SELECT * FROM Products INNER JOIN Suppliers ON Products.SupplierID = Suppliers.ID, Products.Category = Suppliers.Category;
AUsing ON instead of WHERE for join conditions.
BMissing WHERE clause for the second condition.
CUsing comma instead of AND to combine join conditions.
DINNER JOIN cannot have multiple conditions.
Step-by-Step Solution
Solution:
  1. Step 1: Review JOIN condition syntax

    Multiple join conditions must be combined with AND inside the ON clause.
  2. Step 2: Identify the error in the query

    The query incorrectly uses a comma to separate conditions, which is invalid syntax.
  3. Final Answer:

    Using comma instead of AND to combine join conditions. -> Option C
  4. Quick Check:

    Multiple conditions joined by AND, not comma [OK]
Quick Trick: Use AND, not comma, to join multiple ON conditions [OK]
Common Mistakes:
MISTAKES
  • Separating conditions with commas
  • Confusing WHERE and ON clauses
  • Believing INNER JOIN allows only one condition

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes