Given these schema
orders(order_number,created,status) products(product_id,product_name) orders_products(order_number,product_id,quantity)
If I would like to delete orders older than N days, I would have to delete also the records related to those orders in orders_products table.
How could I do this in a single query, without having to retrieve every single order_number, store them in the business logic and finally to run additional queries to clean the mapping table?
I don't have any FK