Paths Subjects Questions Quizzes Pricing Search
Beginner Open Pro

A Customer Exclusion Query Silently Returns Nothing

A marketing team runs this query nightly to find customers eligible for a promotional email — everyone who is not on the suppression list:

SELECT customer_id, email
FROM customers
WHERE customer_id NOT IN (
  SELECT customer_id FROM suppression_list
);

For months, this returned a reasonable list of a few thousand eligible customers each night. Last night it returned exactly zero rows, and the team is convinced "the database is broken" because no code changed. You're asked to investigate.

  1. What is the most likely root cause, and what single fact about the suppression_list.customer_id column would you check first to confirm it?
  2. Explain, mechanically, why this produces exactly zero rows rather than, say, a smaller-than-usual but nonzero list.
  3. Propose a fix, and explain why it's more robust than just "clean the NULL out of suppression_list today," which only fixes today's symptom.

Share this question

← Back to SQL Mental Model & Query Execution Order practice

We use cookies for product analytics to improve OmniAtlas. See our Privacy Policy.