E-commerce & Retail Analytics Path · Mission 10 of 30Easy

Products with zero orders

Use LEFT JOIN + IS NULL to find rows in the left table that have no match in the right. The canonical anti-join — used for inventory pulls, abandoned-cart hunts, and 'who isn't in our CRM' questions.

The Brief

Yara OkekeDirector, E-commerceecom-ops

Quarterly merchandising review. I want every product in `ecom_products` that has NEVER appeared in a line item — i.e., we have inventory, but no demand. Return product_id, title, vendor, inventory_qty so the merchandising team can decide whether to discount, pull, or wait. Use a LEFT JOIN to `ecom_line_items` and filter where the line-item side is NULL. Don't filter on financial_status — even a refunded order means SOMEONE wanted the product; we want zero-attempt items only.

You'll practice

LEFT JOINIS NULL

Tables & columns available

ecom_productsdim8 columns
ColumnTypeKey
product_idINTPK
titleTEXT
vendorTEXT
product_typeTEXT
priceREAL
skuTEXT
inventory_qtyINT
created_dateTEXT
ecom_line_itemsfact6 columns
ColumnTypeKey
line_item_idINTPK
order_idINTFK → ecom_orders
product_idINTFK → ecom_products
quantityINT
priceREAL
skuTEXT

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

LEFT JOIN keeps every left-side (products) row whether or not there's a matching right-side (line_items) row.

Hint 2

`WHERE l.line_item_id IS NULL` drops the matched rows and keeps the unmatched ones. That's the anti-join.

Hint 3

Expected: 1 product. The 12oz drip coffee never moved this period — small inventory, niche grind, and the 32oz cold brew concentrate dominates that vendor's mix.