K
K
Konstantin2018-10-15 16:42:05
SQL
Konstantin, 2018-10-15 16:42:05

Cascading update and delete data?

Suppose we have a Products table and an Orders table , which stores the details of the ordered product.
Obviously Orders.productId is a foreign key. How correct, from the point of view of the business process, is it to cascade the deletion of orders, following the products they refer to? From the point of view of information, information about completed orders is critically important, since the orders table accumulates almost all the basic information on the order. But what's the point of keeping it if the product has already been deleted, in terms of data integrity? Another contradiction arises.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2018-10-15
@tsklab

How correct, from the point of view of the business process, is it to cascade the deletion of orders, following the products they refer to?
Completely wrong. The item just needs to be marked as unused.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question