UPDATESQL

Unit 5, lesson 4 · NULL in conditions, NOT

NULL is not true and not false

Sign-ups that did not come from Instagram

NOT flips a condition: NOT LIKE keeps what LIKE drops, and NOT (price > 100) means price is 100 or less. But a comparison with NULL is neither true nor false: it is unknown, written NULL. NULL = 'Denver' is unknown, and so is NULL <> 'Denver'. NOT does not help, since NOT unknown is still unknown. WHERE keeps only rows where the condition is true, so a row with a missing value drops out of both a filter and its opposite.

Example
SELECT id, full_name, phone
FROM signups
WHERE phone NOT LIKE '303%';
-- 15 sign-ups have a phone, 3 of them start with 303,
-- and this returns 12: the one with no phone is in neither group

Your task

Referral codes that start with IG came from Instagram. Marketing wants every other sign-up, including people who entered no code at all. Return the id, full_name and ref_code.

Tables you will use: signups

Try it in your browserFree, no sign-up. Your query is checked as you go.