Description:
WHERE email IS NULL OR phone IS NULL looks right. It misses three customers.
You reach for IS NULL. How many rows come back?
SELECT name, email, phone
FROM customers
WHERE COALESCE(email,'') NOT LIKE '%@%' OR COALESCE(phone,'') = '';
How SQL runs it, step by step:
1. FROM customers
2. WHERE COALESCE(email,'') NOT LIKE '%@%' OR COALESCE(phone,'') = ''
3. SELECT name, email, phone
Takeaway: Missing hides as NULL, empty, or junk. Test for all three. Next: a new week.
Follow @visual.sql101 for a new visual SQL lesson every Monday, Wednesday and Friday.
#sql #learnsql #sqlchallenge #sqlinterview #dataanalyst #interviewprep #sqlforbeginners #Shorts
Share this link via
Or copy link
























