Bird
0
0

Consider this query:

medium📝 Debug Q14 of 15
SQL - Advanced Joins
Consider this query:
SELECT * FROM Customers FULL OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerID WHERE Orders.OrderID IS NULL;

What is the likely purpose of this query?
ATo find orders without customers.
BTo find customers who have no orders.
CTo find all customers and orders regardless of match.
DTo find customers with at least one order.
Step-by-Step Solution
Solution:
  1. Step 1: Understand FULL OUTER JOIN with WHERE filter

    The join returns all customers and orders; filtering WHERE Orders.OrderID IS NULL keeps rows where no matching order exists.
  2. Step 2: Interpret the filter effect

    Rows with NULL in Orders.OrderID mean customers without orders are selected.
  3. Final Answer:

    To find customers who have no orders. -> Option B
  4. Quick Check:

    Filter NULL in Orders = customers without orders [OK]
Quick Trick: Filter NULL in joined table to find unmatched rows [OK]
Common Mistakes:
MISTAKES
  • Thinking it finds orders without customers
  • Assuming it returns all rows without filtering
  • Confusing NULL filter with matching rows

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes