Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the integrity of the database?

Shulou Source: shulou.com Published: 2022-06-01 18:08:36 09月16日 Update

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 tests.

1. Entity integrity

Entity integrity is a constraint on the uniqueness of records in a relationship, that is, the primary key. To be precise, entity integrity means that the primary attribute value in a relationship cannot be Null and cannot have the same value. Define the unique identification of all rows in the table, generally using the primary key, unique index unique keyword, and identity attributes such as our ID number, can uniquely identify a person.

2. Domain integrity

Domain integrity is the constraint on the field attributes in the data table, which usually refers to the validity of the data. It includes constraints such as the range of the field, the type of the field and the valid rules of the field. It is determined by the properties of the field defined when determining the relationship structure. Limit data types, defaults, rules, constraints, whether they can be empty, and domain integrity ensures that invalid values are not entered.

3. Referential integrity

Referential integrity is a constraint on the reference of data between tables that establish relationships in a relational database, that is, a constraint on foreign keys. Specifically, referential integrity means that the foreign key in a relationship must be a valid value for the primary key of another relationship, or NULL. Referential integrity maintains the validity and integrity of inter-table data, usually by establishing an external key to contact the primary key of another table, and can also use triggers to maintain referential integrity.

These are the details of database integrity, please pay more attention to other related articles!

Tags: Integrity data database valid fields attributes entities validity that is data tables identities types rules references inputs restrictions same consistent personal range Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker MariaDB MySQL Shulou Technology Shulou Information