Reptiles data integrity check result

Data integrity is divided into three areas:

1, the integrity field (column)

  Types of restrictions of input data, and range, or format, such as gender field must be "male" or "female" is not allowed to insert other data, performance data fields can only be an integer from 0 to 100, the contents of the email field must conform mailbox regular expressions

2, entity integrity (lines)

  Requires all rows in the table has a unique identifier. This may be a unique identifier, it may be a combination of several columns, called the primary key. That is, the primary key table must take on a unique value in all rows.

3, referential integrity (Table)

  Referential integrity is based on a relationship between the primary key and a foreign key, the data must be present in the primary table from an outer key table can not reference the primary key value does not exist in the primary table, when the input data is changed or deleted master table, table linkage required changes to ensure data consistency.

 

According to the above concept, the integrity check data is from the  "column", "line", "tables"  of the dimensions.

 

Some constraints are built in the time table has been carried out according to the constraint database definition language DDL statements.

1, domain integrity constraints

  The method of integrity are mandatory fields: type of restriction (by setting the data type of column), the format (through CHECK constraints and rules) or the range (by FOREIGN KEY constraints, CHECK constraints, the DEFAULT defines possible values, NOT NULL definitions and rules )

2, entity integrity constraints

  Method entity integrity are mandatory: index, UNIQUE constraint, PRIMARY KEY constraints, or IDENTITY properties.

3, referential integrity constraints

  Method enforce referential integrity are: primary foreign key relationship

 

In fact, you can see the physical integrity is certainly in line, because there is no primary key is not to build a table, referential integrity constraints will generally be constrained in the construction of the table, check the emphasis domain integrity check, that check column data content,

  

Guess you like

Origin www.cnblogs.com/gcgc/p/11403723.html