Chapter2 关系数据库基础

关系数据库结构

table、relation、attributes

key

A superkey (超键) is a set of one or more attributes that, taken collectively, can be used to identify uniquely a tuple in the relation.

K is a candidate key (候选键) if K is minimal super key. e.g.{ID} is a candidate key for instructor, assuming no two instructors can possibly have the same identifiers. A relation may have several candidate keys

Primary key (主键) is a candidate key chosen by the database designer as principal means to identify tuples within a relation

Def. Primary attributes (主属性!) taking the key as a attribute set, the attributes in the candidate keys, i.e. the element of the primary key is called the primary attributes non-primary attributes (非主属性)

Super key >= candidate key >= primary key

relational algebra (关系代数)

Six basic operators

(选择) select: $\sigma$ (投影) project: (笛卡尔积) Cartesian product: x (集合并) union: (集合差) set difference: – (重命名) rename: alt text

复合关系运算

alt text 暂时值(Assignment) alt text

Built with Hugo
Theme Stack designed by Jimmy