<aside> 💡
This project identifies customers who were not referred by the customer with id = 2. The solution demonstrates SQL skills in conditional filtering and handling NULL values.
</aside>
NULL if no referral).The task is to retrieve the name of customers whose referee_id is not equal to 2 or is NULL.
The query filters the Customer table for rows where the referee_id is either not equal to 2 or is NULL.
SELECT
name
FROM
Customer
WHERE
referee_id != 2
OR referee_id IS NULL;
referee_id != 2: Includes customers referred by someone other than the customer with id = 2.referee_id IS NULL: Includes customers who were not referred by anyone.name column is retrieved for clarity.Customer Table: