Bird
0
0

What is the primary purpose of the EXISTS operator in SQL?

easy📝 Conceptual Q1 of 15
SQL - Subqueries
What is the primary purpose of the EXISTS operator in SQL?
ATo update rows in a table
BTo check if a subquery returns any rows
CTo join two tables based on a condition
DTo count the number of rows in a table
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of EXISTS

    The EXISTS operator tests whether a subquery returns any rows.
  2. Step 2: Compare with other options

    Counting rows, joining tables, or updating rows are different SQL operations unrelated to EXISTS.
  3. Final Answer:

    To check if a subquery returns any rows -> Option B
  4. Quick Check:

    EXISTS purpose = check rows [OK]
Quick Trick: EXISTS checks if subquery has rows, not data itself [OK]
Common Mistakes:
MISTAKES
  • Confusing EXISTS with COUNT
  • Thinking EXISTS joins tables
  • Using EXISTS to update data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes