Bird
0
0

Identify the error in the following SQL query:

medium📝 Debug Q6 of 15
SQL - Set Operations
Identify the error in the following SQL query:
SELECT name FROM Employees INTERSECT Employees2;
ANo error, query is correct
BINTERSECT cannot be used with SELECT
CTable names cannot be used with INTERSECT
DMissing SELECT keyword before second table
Step-by-Step Solution
Solution:
  1. Step 1: Check syntax for INTERSECT

    Both sides of INTERSECT must be SELECT queries.
  2. Step 2: Identify missing SELECT

    The second part 'Employees2' lacks SELECT keyword, causing syntax error.
  3. Final Answer:

    Missing SELECT keyword before second table -> Option D
  4. Quick Check:

    Both sides must be SELECT queries [OK]
Quick Trick: Both sides of INTERSECT must be SELECT queries [OK]
Common Mistakes:
MISTAKES
  • Omitting SELECT in second query
  • Using INTERSECT without SELECT
  • Assuming table names alone work

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes