Find Customer Referee

2pts
Amazon, Uber

Problem Statement

A marketing team needs to analyze customer acquisition sources. Specifically, they want to identify customers who were not introduced to the platform by a specific referee.

Write an SQL query to report the names of the customers that are not referred by the customer with ID 2.

Rules:

  • Return the name column only.
  • Customers with no referee (NULL values) must be included in the results.
  • The order of the result does not matter.
Tests your understanding of
Basic SQL, Filtering, NULL Handling and Logical Operators

Input Tables

customer
id(INTEGER)name(VARCHAR)referee_id(INTEGER)
1Willnull
2Janenull
3Alex2
4Billnull
5Zack1
6Mark2

Expected Output

name(VARCHAR)
Will
Jane
Bill
Zack

Tags

EasyBasic SQLFilteringNULL HandlingLogical Operators
5-10 min
72%

Hints