Practice · medium · dataset: ecom

Pending order details

Support needs a line-level view of pending orders. Return order_id, customer email, product_id, product name, quantity, and line_total rounded to two decimals for every line item on a pending order.

Sort by order_id ascending, then by product_id ascending.

Tables available

Table Columns
customers customer_id, email, country, signup_date
orders order_id, customer_id, order_date, status, channel
order_items order_id, product_id, quantity, unit_price
products product_id, name, category, unit_price

One row per line item is expected. Use the unit price stored on the line, not the product’s current price.

⌘/Ctrl + Enter to grade

Write a query, then grade it.

Hints

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