我们常说的关系型数据库指的是满足关系模型的数据库。
下表是在SQL中使用的名称和关系型模型中使用的名称的对应关系。
SQL | Relational database | database Description |
---|---|---|
Row | Tuple | Data set with specific instances in the range of each member |
Column | Attribute | Labeled member in the set of elements common to all data sets; A name, word, number, phrase, etc. |
Table | Relation;Baserelvar | Formal data structure |
Set of column names | Relation scheme; Set of attributes | A schema |
View; Query result; Result set | Derived relvar | A data report from the RDBMS in response to a query |
由上图可见,所谓的关系,指的就是不同的attribute组成tuple时形成的一种关系。该模型的表现形式就是结构相同的rows(即符合同一种schema)被组织到一个table中,而不同的table之间用外键关联。从本质上说,外键反应的是不同table间的row的关系而不是table之间的关系。而我们对关系型数据库的操作其实就是对tuples的操作–增加,修改或返回rows。