- Learning PostgreSQL 10(Second Edition)
- Salahaldin Juba Andrey Volkov
- 225字
- 2021-07-02 22:42:03
Entity integrity constraint
In the relational model, a relation is defined as a set of tuples. This means that all the tuples in a relation must be distinct. The entity integrity constraint is enforced by having a primary key which is an attribute/set of attributes having the following characteristics:
- The attribute should be unique
- The attributes should be not null
Each relation must have only one primary key, but can have many unique keys. A candidate key is a minimal set of attributes that can identify a tuple. All unique, not null attributes can be candidate keys. The set of all attributes form a super key. In practice, we often pick up a single attribute to be a primary key instead of a compound key ( a key that consists of two or more attributes that uniquely identify a tuple) to ease the joining of the relations with each other.
If the primary key is generated by the DBMS, then it is called a surrogate key or synthetic key . Otherwise, it is called a natural key. The surrogate key candidates can be sequences and universal unique identifiers (UUID). A surrogate key has many advantages such as performance, requirement change tolerance, agility, and compatibility with object relational mappers. The chief disadvantage of surrogate keys is that , it makes redundant tuples possible.
- Linux Mint System Administrator’s Beginner's Guide
- 傳感器技術實驗教程
- 基于LabWindows/CVI的虛擬儀器設計與應用
- 實時流計算系統設計與實現
- JMAG電機電磁仿真分析與實例解析
- Python Data Science Essentials
- 西門子S7-200 SMART PLC實例指導學與用
- AutoCAD 2012中文版繪圖設計高手速成
- 計算機系統結構
- 具比例時滯遞歸神經網絡的穩定性及其仿真與應用
- 計算機網絡原理與技術
- 樂高機器人—槍械武器庫
- Ansible 2 Cloud Automation Cookbook
- 貫通Java Web輕量級應用開發
- 機器人制作入門(第4版)