What are the integrity constraints of database design?

Source: Internet
Author: User

What are the integrity constraints of database design?

What are the integrity constraints of database design? Here are four aspects:

1. Domain integrity:The columns in the database table must meet certain data types or constraints. The constraints include the value range and accuracy. Use Check to implement constraints. In the database design tool, when defining the value range of a field, there is a Check button that defines the Value City of the field.

2. Integrity of reference:Defines the reference rules between the external code and the primary code. It is implemented using PK, FK, and table-level triggers. The principle rule is that if attribute (or attribute group) f is the external code of the basic relationship r, it corresponds to the primary code ks of the basic relationship s (the basic relationship r and s are not necessarily different), then the value of each tuples in r on f must be: or take a null value (each attribute value of f is null) or equal to the primary code value of a tuples in s.

3. entity integrity rules ):If attribute a is the primary attribute of basic link r, attribute a cannot be null. Because entity integrity rules are for basic relationships. A basic table usually corresponds to an entity set or many-to-many relationship in the real world. The relationships between entities and entities in the real world are differentiated, that is, they have some unique identifier, and the relational model of database design must comply with the entity integrity rules.

4. User-Defined integrity:User-Defined integrity is a constraint on a specific relational database, reflecting the semantic requirements that must be met by the data involved in a specific application. The relational model should provide mechanisms to define and test such integrity so that they can be processed in a unified and systematic manner, rather than undertaken by applications. It is a business rule that is implemented using stored procedures and triggers.

The above is all the content of this article, hoping to help you learn.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.