---
title: "How to describe Data consistency in better way"
description: "The database consistency is very important to get up to date information. In DB2 database why data consistency is necessary and best explained with example when it is needed. Committing the data is a main task in data consistency."
url: https://srinimf.com/2016/09/29/how-to-describe-data-consistency-in-better-way/
date: 2016-09-29
modified: 2026-10-10
author: "Srini"
categories: ["DB2 V10"]
tags: ["Data consistency in DB2 examples"]
type: post
lang: en
---

# How to describe Data consistency in better way

[![[ Data Consistency in DB2 ]](https://i0.wp.com/srinimf.com/wp-content/uploads/2016/09/data-in-db2.png?resize=206%2C198&ssl=1)](https://i0.wp.com/srinimf.com/wp-content/uploads/2016/09/data-in-db2.png?ssl=1)*[ Data Consistency in DB2 ]*

What data consistency is – in many occasions, single user and multi user environments, put DB2 in data consistency issues.

**Let me explain in simple way – The best way to answer that question is by looking at an example:**

Suppose a company that owns a chain of restaurants uses a database to keep track of, among other things, the inventory at each restaurant. The database contains inventory tables for every restaurant in the chain and as a restaurant receives and uses supplies, its corresponding inventory table is updated.

Now, suppose a case of coffee is physically moved from one restaurant (which has plenty of coffee in stock) to another (which has just run out). To reflect this inventory move, the cans of coffee value stored in the receiving restaurant’s inventory table will need to be raised, and the cans of coffee value stored in the donating restaurant’s table will need to be lowered. If a user raises the cans of coffee value in the receiving restaurant’s table but fails to lower the value in the donating restaurant’s table, the data in the database will no longer be consistent.

Related[Why DELETE with Subqueries Fails in PySpark SQL (And How to Fix It)](https://srinimf.com/2026/01/01/why-delete-with-subqueries-fails-in-pyspark-sql-and-how-to-fix-it/)

The total cans of coffee value for the entire chain is no longer accurate; nor [is the](https://srinimf.com/2012/11/20/sdlc-methods-agile-and-waterfall/) cans of coffee value for the donating restaurant.

What [happens in](https://srinimf.com/2016/03/03/how-program-control-happens-in-cobol-run-unit/) single user model

In single-user environments, a database can become inconsistent if a user fails to make the necessary changes (as in the previous example), if the database system crashes while a user or application is in the middle of making changes or if an application terminates prematurely.

What happens in multi user model

In multi-user environments, inconsistency can also occur when several users or applications attempt to access the same data at the same time. For example, given the scenario just presented, if one user queries the database to obtain the cans of coffee count for the receiving restaurant while another user is updating both restaurants’ inventory tables to show that a case of coffee was moved from one restaurant to another before the updates are committed, the query will erroneously indicate that no more cans of coffee are available.

Related[How to describe Data consistency in better way](https://srinimf.com/2016/09/29/how-to-describe-data-consistency-in-better-way/)

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2016%2F09%2F29%2Fhow-to-describe-data-consistency-in-better-way%2F&media=https%3A%2F%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2016%2F09%2Fdata-in-db2.png&description=How%20to%20describe%20Data%20consistency%20in%20better%20way)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2016/09/29/how-to-describe-data-consistency-in-better-way/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2016/09/29/how-to-describe-data-consistency-in-better-way/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2016/09/29/how-to-describe-data-consistency-in-better-way/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2016/09/29/how-to-describe-data-consistency-in-better-way/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20How%20to%20describe%20Data%20consistency%20in%20better%20way&body=https%3A%2F%2Fsrinimf.com%2F2016%2F09%2F29%2Fhow-to-describe-data-consistency-in-better-way%2F&share=email)
-

### Like this:

Like Loading…
