'Clothing': past cancellations, none in Aug 4–17, 2025
Instructions
Find products in the category 'Clothing' (category_id = 3) that were in cancelled orders before, but not in the given period. "Was in a cancelled order" means: has an item in an order with the status 'cancelled'. The period: the order was created on or after August 4, 2025 and strictly before August 18, 2025; "before" means the order was created strictly before August 4, 2025. Output id, name, price and last_cancelled: the creation date of the latest such order before the period (created_at cast to date). 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
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
Select a table in the diagram or list to view its rows.