From the course: Learning Relational Databases

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Prevent data conflicts

Prevent data conflicts

From the course: Learning Relational Databases

Start my 1-month free trial

Prevent data conflicts

- [Instructor] Another source of common data conflicts occurs when stored values are simply calculated from other information that we're already storing or keeping track of. The problem is that if one value changes, then we need to be sure to update the calculation as well. Here's an example. Let's take a look again at the invoices for our olive oil sales. We can see that Delish Food purchased two bottles of our First Cold Press oil. If we look up the price in the products table, we can see that the First Cold Press olive oil is $10 per bottle. So the invoice correctly shows the total due as $20. This is good and accurate information for now, but what happens if something changes? If the order quantity gets changed, from say two to four, then we also need to have the database management system update the total price as well, to reflect the new total due as $40 instead of 20. Or, if the price per bottle change in the products table to $15, then again, the total price in the invoices…

Contents