Server
Integrity is the consistency and validity of data in a database. The usual statements are entity (ROW) integrity, domain (column) integrity, and referential integrity (refer to SQL Server).
Entity integrity defines all rows in the table that are uniquely identified, typically with primary keys, unique indexes unique keywords, and identity attributes such as our ID number to uniquely identify a person.
Domain integrity usually refers to the validity of the data, limiting the data type, default value, rules, constraints, whether it can be null, and domain integrity to ensure that no invalid values are entered.
Referential integrity maintains the validity and completeness of data between tables, usually by establishing a foreign key to contact another table's primary key, for example, there are two tables in the Library management system, one is the staff table (Pid,pname ...) , to record the information of the borrower, in order to ensure the uniqueness of the personnel, can be in the field of PID primary key, unique index. The other is the loan schedule (... pid ...).), in the loan list to build a foreign key to two of the table of the PID link, to ensure that the people in the loan table in the range, in addition, if someone in the lending table has not yet recorded the books, then he can not be deleted in the people table. You can also use triggers to maintain referential integrity.