SQL data engineering interview problem. Difficulty: beginner. Pattern: Joins. About 8 minutes. Part of the Pro drill bank.
Using customers and lb_orders, find customers who have never placed an order. Columns: customer_id, name. Order by customer_id. Prefer LEFT JOIN ... WHERE order_id IS NULL (problem 48 revisits NOT EXISTS).
Input: customers lb_orders customer_id | name customer_id C03 | Cam C03 C04 | Dee (no rows) C05 | Eli (no rows) Output: customer_id | name C04 | Dee C05 | Eli Why this passes: Cam has orders. Dee and Eli have none.
Topics: lakebench, sql, anti-join, left join.
More SQL interview questions · All interview problems · Learn data engineering
Interview-style drill: Anti-join customers with no rows in lb_orders.
Using `customers` and `lb_orders`, find customers who have never placed an order. Columns: `customer_id`, `name`. Order by `customer_id`. Prefer LEFT JOIN ... WHERE order_id IS NULL (problem 48 revisits NOT EXISTS).