我对data consistencydata integrity有点困惑.从Oracle Database Concepts:

data integrity
--------------
Business rules that dictate the standards for acceptable data. These rules
are applied to a database by using integrity constraints and triggers to
prevent invalid data entry.

Wikipedia

Consistency
-----------
Consistency states that only valid data will be written to the database.

那么data consistencydata integrity之间有什么区别呢?

提前谢谢您.

推荐答案

They are not only different, they are orthogonal.

Inconsistency:
A DB that reported employee Joe Shmoe's department as Sales but that didn't list Joe Shmoe among the employees in the Sales department would be inconsistent.
It's a logical property of the DB, independent of the actual data.

Integrity:
A DB that reported jOe SaleS to be a member of the Shmoe department would lack integrity.
jOe SaleS isn't a valid employee name and Shmoe isn't a valid department.
That's not logically invalid, but it is invalid relative to the rules that govern data content.

Database相关问答推荐

如何从大型Oracle数据库中删除列?

Kusto:从一个表中复制行并追加到同一集群中的另一个表中

用于在 Excel 中的两个列表之间进行筛选的辅助列

将数据集上传到 Hub 时停止运行时会导致什么?

数据库设计:文件路径的首选字段长度

如何使用错误消息中指定的 tbspaceid tableid 在 DB2 中查找表和列

Mysql - 在所有数据库中查找表

Android Room持久性库@Update不起作用

如何将开发数据库更改移动到生产数据库?

skip bad record in redshift data load

MySQL 中的多个 OR 子句

在 MS SQL 中使用 GUID 作为主键是不是一个坏主意?

SQL Server 2008 中的 Open Table go 了哪里?

如何取消长时间运行的数据库操作?

多币种 - 存储什么以及何时转换?

遍历数据库中的每条记录 - Ruby on Rails / ActiveRecord

使用 liquibase 更新表中的一行

SQLite 数据库方案作为实体关系模型

将 NULL 插入 MySQL 时间戳

什么是 ACID 的真实示例?