Bird
0
0

Find the error in this SQL query:

medium📝 Debug Q6 of 15
SQL - INNER JOIN
Find the error in this SQL query:
SELECT * FROM Sales INNER JOIN Customers ON Sales.CustomerID = Customers.ID, Customers.Region = 'North';
AUsing a comma instead of AND to combine join conditions in the ON clause
BMissing WHERE clause for filtering Customers.Region
CIncorrect table aliasing for Sales and Customers
DUsing INNER JOIN instead of LEFT JOIN
Step-by-Step Solution
Solution:
  1. Step 1: Understand JOIN condition syntax

    Multiple conditions in ON must be combined with AND, not commas.
  2. Step 2: Analyze the query

    The query uses a comma between conditions inside ON, which is invalid syntax.
  3. Final Answer:

    Using a comma instead of AND to combine join conditions in the ON clause -> Option A
  4. Quick Check:

    Multiple ON conditions require AND, not commas [OK]
Quick Trick: Combine ON conditions with AND, not commas [OK]
Common Mistakes:
MISTAKES
  • Using commas instead of AND in ON clause
  • Placing filtering conditions inside ON incorrectly
  • Confusing WHERE clause with ON clause

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes