主键与外键
1. 主键(Primary Key)
(1) 候选键 (Candidate Key)
Candidate Key:A candidate key is a column (attribute) or columns that could uniquely identify a row (tuple) in the table (relation)
候选键(Candidate Key):候选键是一个列(属性)或多个列,它们可以惟一地标识表(关系)中的行(元组)
(2)主键(Primary Key )
①Primary Key: A primary key is the ‘best’ candidate key for a particular table; it is the one that is implemented
主键(Primary Key): 键是特定表的最佳候选键;它是实施的。
②If a candidate key does not exist an additional column is created to become the primary key (often given the name ‘ID’ -IDentification)——This is called a surrogate key
如果候选键不存在,则会创建一个附加列作为主键(通常使用名称“ ID” -IDentification)——这被称为 “代理键”
③Some candidate or primary keys consist