Categories: from 110 items, quantity from 3
Level: Junior50 XP
Instructions
Consider the order items (order_items) with quantity at least 3 and an item price (order_items.price) of at least 100. Group them by the product category (products.category_id) and select category_id, the number of items items_cnt and the total number of units units (the sum of quantity). Keep the categories where items_cnt is at least 110. Row order does not matter.
Hints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Exactly oneZero or oneZero or more
Table relationships
- N:1Many-to-one
order_items.→order_id orders.id - N:1Many-to-one
order_items.→product_id products.id - N:1Many-to-one
orders.→customer_id customers.id - N:1Many-to-one
products.→category_id categories.id
Table data
PostgreSQL
Select a table in the diagram or list to view its rows.