Practice · medium · dataset: ecom

Orders with multiple products

Find orders that contain more than one distinct product. Return order_id, product_count, and order_total rounded to two decimals.

Sort by product_count descending, then by order_id ascending.

Tables available

Table Columns
order_items order_id, product_id, quantity, unit_price

The table has at most one row per order and product, so product_count is the number of distinct products in the order. An order with a single product must not appear.

⌘/Ctrl + Enter to grade

Write a query, then grade it.

Hints

Try it first. Reveal a hint only when you are stuck.