Home  >  Article  >  Database  >  What three types of database integrity include

What three types of database integrity include

Guanhui
GuanhuiOriginal
2020-05-28 17:32:4238940browse

What three types of database integrity include

What three types of database integrity include

1. Entity integrity

Entity integrity Sex is a constraint on the uniqueness of records in a relationship, that is, the primary key. To be precise, entity integrity means that the main attribute value in the relationship cannot be Null and cannot have the same value. All rows in the definition table can be uniquely identified. Generally, the primary key, unique index, unique keyword, and identity attribute, such as our ID card number, can uniquely identify a person.

2. Domain integrity

Domain integrity is a constraint on the field attributes in the data table. It usually refers to the validity of the data. It includes the value range of the field, Constraints such as field types and field valid rules are determined by the attributes of the fields defined when determining the relationship structure. Limit data types, default values, rules, constraints, whether it can be empty, and domain integrity to ensure that invalid values ​​are not entered.

3. Referential integrity

Referential integrity is a reference to data between data tables that establishes relationships in a relational database Constraints, that is, constraints on foreign keys. To be precise, referential integrity means that the foreign key in a relationship must be a valid value of the primary key of another relationship, or NULL. Referential integrity maintains the validity and integrity of data between tables, usually by establishing a foreign key to contact the primary key of another table. Triggers can also be used to maintain referential integrity

What is database integrity

Database integrity ensures that the data entered into the database is accurate, valid and consistent. Any data changes in the database must comply with all integrity restrictions and data validity checks.

Recommended tutorial: "MySQL Tutorial"

The above is the detailed content of What three types of database integrity include. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn