Bird
0
0

What is wrong with this query?

medium📝 Debug Q14 of 15
SQL - Set Operations
What is wrong with this query?
SELECT name FROM employees EXCEPT name FROM managers;
AEXCEPT cannot be used with column names
BMissing SELECT keyword before second query
CSyntax requires JOIN instead of EXCEPT
DNo error, query is correct
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax of EXCEPT usage

    EXCEPT requires two full SELECT statements. The second query must start with SELECT.
  2. Step 2: Identify error in given query

    The second part is missing SELECT before name FROM managers, causing syntax error.
  3. Final Answer:

    Missing SELECT keyword before second query -> Option B
  4. Quick Check:

    EXCEPT needs two SELECTs [OK]
Quick Trick: Always write SELECT before both queries with EXCEPT [OK]
Common Mistakes:
MISTAKES
  • Omitting SELECT in second query
  • Using EXCEPT with columns only
  • Confusing EXCEPT with JOIN syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes