AnalystPath

Most Frequently Ordered Item per Store

SQLMediumMid levelInstacart~15 min

Problem

**[Asked at Instacart]**

For each store on the Instacart platform, find the **item ordered most
frequently** (by total number of order-line appearances).

Return `store_id`, `item_name`, and `order_count`,
ordered by store then item name.

Tables

Example rows — the live problem includes the full dataset.

stores
store_idstore_name
items
item_iditem_name
orders
order_idstore_idorder_date
order_items
oi_idorder_iditem_id

Expected output

Your answer should return 2 rows with the columns store_id, item_name, order_count.

Starter code (SQL)

SELECT *
FROM stores;

Solve this SQL question free

Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.

Solution & explanation

Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.

Sign up free to unlock

Related SQL questions