Bird
0
0

Find the mistake in this SQL query:

medium📝 Debug Q7 of 15
SQL - INNER JOIN
Find the mistake in this SQL query:
SELECT c.name, o.order_date FROM customers c INNER JOIN orders o ON c.id = o.customer_id WHERE o.status = 'shipped';
AMissing alias for orders table
BIncorrect alias usage in SELECT clause
CUsing WHERE instead of ON for join condition
DNo mistake, query is valid
Step-by-Step Solution
Solution:
  1. Step 1: Check alias declarations

    Aliases c and o are declared and used properly.
  2. Step 2: Verify join and filter clauses

    Join uses ON correctly; WHERE filters after join, which is correct.
  3. Final Answer:

    No mistake, query is valid -> Option D
  4. Quick Check:

    Proper alias and join syntax = Valid query [OK]
Quick Trick: ON for join, WHERE for filtering is correct [OK]
Common Mistakes:
MISTAKES
  • Confusing WHERE and ON clauses
  • Forgetting to alias tables
  • Misusing aliases in SELECT

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes