Data inconsistency occurs when related stored data no longer agrees or reflects a valid state. It can happen when one step in a multi-step operation succeeds but a later step fails. section 13.0 section 13.1
A money transfer goes wrong
A transfer subtracts money from one account, then adds it to another. If the second step fails, the money is lost; if it is mistakenly repeated, the destination account may receive too much. A transaction treats both changes as one unit: it commits both on success or rolls back changes if a step fails. section 13.0 section 13.1
Figure 13.1 An example of a use case. When transferring money from one account to another account, the app executes two operations: it subtracts the transferred money from the first account and adds it to the second account. We’ll implement this use case, and we need to make sure its execution won’t generate inconsistencies in data.

Trace the two account changes in a transfer and see why they must succeed or fail together. section 13.1

