RienSQL
TASK #157 · Medium · Zalando

Average Items Per Order

Your brief
The orders table holds Zalando's orders; order_items stores the line items of each order (order_id, product_id, quantity).

Write a query that returns a single number — the platform-wide average number of items (sum of quantity) per order. Round the answer to two decimals and name the column avg_items_per_order.
Expected columnsavg_items_per_orderZalando
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
productsproduct_id, product_name, category, price
reviewsreview_id, product_id, user_id, submit_date, stars
inventoryinventory_id, product_id, status, add_date
ordersorder_id, user_id, order_date
order_itemsitem_id, order_id, product_id, quantity