Bird
0
0

Which of the following is the correct syntax to find rows in table1 not in table2 using EXCEPT?

easy📝 Syntax Q12 of 15
SQL - Set Operations
Which of the following is the correct syntax to find rows in table1 not in table2 using EXCEPT?
ASELECT * FROM table1 WHERE NOT IN table2;
BSELECT * FROM table1 MINUS table2;
CSELECT * FROM table1 EXCEPT SELECT * FROM table2;
DSELECT * FROM table1 JOIN table2 EXCEPT;
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct EXCEPT syntax

    The EXCEPT operator is used between two SELECT statements: SELECT ... FROM ... EXCEPT SELECT ... FROM ....
  2. Step 2: Check each option

    SELECT * FROM table1 EXCEPT SELECT * FROM table2; uses correct syntax with two SELECT statements separated by EXCEPT. SELECT * FROM table1 MINUS table2; is incorrect because MINUS requires SELECT before both tables. SELECT * FROM table1 WHERE NOT IN table2; is invalid syntax. SELECT * FROM table1 JOIN table2 EXCEPT; misuses JOIN and EXCEPT.
  3. Final Answer:

    SELECT * FROM table1 EXCEPT SELECT * FROM table2; -> Option C
  4. Quick Check:

    Correct EXCEPT syntax = SELECT ... EXCEPT SELECT ... [OK]
Quick Trick: EXCEPT goes between two SELECT queries, no JOIN needed [OK]
Common Mistakes:
MISTAKES
  • Using EXCEPT without two SELECT statements
  • Confusing MINUS syntax with EXCEPT
  • Trying to use EXCEPT with JOIN

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes