SQL: Customers Never Ordered
Medium
SQL — Joins
SQL
LEFT JOIN
IS NULL
Find customers who never placed an order.
Constraints
Write standard SQL (MySQL 8.0 compatible).
Examples
Example 1:
Input: cust_id name
1 Ahmed
2 Sara
Output:
Example 2:
Input: cust_id name
1 Ahmed
2 Sara
Output:
Hints
LEFT JOIN with NULL check or NOT IN.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console