Bird
0
0

Identify the error in this query:

medium📝 Debug Q6 of 15
SQL - INNER JOIN
Identify the error in this query:
SELECT a.name, b.salary FROM employees a INNER JOIN salaries b ON a.emp_id = b.emp_id WHERE b.salary > 50000;
ANo error, query is correct
BIncorrect join condition syntax
CMissing table alias declaration
DUsing WHERE instead of ON for join
Step-by-Step Solution
Solution:
  1. Step 1: Check alias usage

    Aliases a and b are declared and used correctly.
  2. Step 2: Verify join and filter syntax

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

    No error, query is correct -> Option A
  4. Quick Check:

    Correct alias and join syntax = No error [OK]
Quick Trick: Use ON for join, WHERE for filtering [OK]
Common Mistakes:
MISTAKES
  • Confusing WHERE and ON clauses
  • Forgetting to declare aliases
  • Incorrect join condition format

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes