官术网_书友最值得收藏!

  • Learning PostgreSQL 11
  • Salahaldin Juba Andrey Volkov
  • 161字
  • 2021-07-02 13:11:38

Constraint

The relational model defines many constraints in order to control data integrity, redundancy, and validity. Here are some examples of checking for data:

  • Redundancy: Duplicate tuples are not allowed in the relation.
  • Validity: Check constraints and domain constraints are used to validate the data input, for example, the date of birth should be a date that occurred in the past.
  • Integrity: The relations within a single database are linked to each other. An action on a relation such as updating or deleting a tuple might leave the other relations in an invalid state.

We could classify the constraints in a relational database roughly into two categories:

  • Inherited constraints from the relational model: Domain integrity, entity integrity, and referential integrity constraints.
  • Semantic constraint, business rules, and application-specific constraints: These constraints cannot be expressed explicitly by the relational model. However, with the introduction of procedural SQL languages such as PL/pgSQL for PostgreSQL, relational databases can also be used to model these constraints.
主站蜘蛛池模板: 平乡县| 阿尔山市| 通化市| 丰顺县| 龙泉市| 乐平市| 洮南市| 罗城| 孟连| 乌兰县| 吉水县| 鄂托克旗| 平武县| 信阳市| 高邮市| 靖远县| 六安市| 循化| 城口县| 旅游| 白城市| 崇义县| 富锦市| 衡南县| 海兴县| 邵阳县| 河源市| 邻水| 防城港市| 富源县| 金堂县| 邵阳市| 界首市| 齐齐哈尔市| 仁化县| 潼南县| 偃师市| 梁山县| 沛县| 怀远县| 洛宁县|