183. Customers Who Never Order
https://leetcode.com/problems/customers-who-never-order
Pandas
import pandas as pd
def find_customers(customers: pd.DataFrame, orders: pd.DataFrame) -> pd.DataFrame:
result = pd.DataFrame()
result['Customers'] = customers[~customers.id.isin(
orders.customerId
)]['name']
return result
SQL
SELECT
Customers.name AS Customers
FROM Customers
WHERE id NOT IN (
SELECT DISTINCT customerId
FROM Orders
)