Skip to main content
All Problems
medium0% acceptance

Orders with the Most Line Items

Find the orders that have the most distinct products (line items). Return the order_id, the count of distinct products, and the order total_amount. Show only orders whose product count equals the maximum across all orders.

Schema

🔑idINT
🔗customer_idINT
order_dateTEXT
statusTEXT
total_amountREAL
postgresql

Run your query to see results

Press Ctrl + Enter to execute