数据库目录上
- 1、INFORMATION ANS DATABASE SYSTEM
- 1.1 from information and data
- 1.2 database system
- data model
- 1.3 (database management system)-->DBMS
- DML
- DBMS 3-Tier Architecture
- 1.4 History of Data Management
- HDBS
- NDBS
- 2、THE RELATIONAL DATA MODEL
- Terminologies of a Relation
- key
- 3、RA and SQL
- 3.1 Relational Algebra
- Union
- (-) Difference
- Intersection
- Cartesian Product(X)
- SELECt operation
- Projection Operation
- join
- Theta Join
- EquiJoin
- natural join
- 三种join
- Division()
- examples
1、INFORMATION ANS DATABASE SYSTEM
1.1 from information and data
-
monotonically Increasing(单调增长)
-
Infinitely Replicable(无限复制)
-
Derivation(推导):related information will generate new information
1.2 database system
data model
-
structure
-
operations
-
constraints
1.3 (database management system)–>DBMS
DML
过程型:DMLs
非过程型:Non-procedural DML --- a user is required to specify ONLY WHAT data is
needed but NOT HOW to get it.(sql)
DBMS 3-Tier Architecture
1.4 History of Data Management
File based system-->Hierarchical database systems(HDBS)-->Network databses systems(NDBS)-->Relational database systems(RDBMS)
-->Object-oriented and Object-Retional database systems(OODBS)
HDBS
NDBS
2、THE RELATIONAL DATA MODEL
Terminologies of a Relation
key
唯一确定
如果有任何一个attributes从key中移除,就不是key(minimality property)
假设有如下两个表:
学生(学号,姓名,性别,身份证号,教师编号)
教师(教师编号,姓名,工资)
超键:
由超键的定义可知,学生表中含有学号或者身份证号的任意组合都为此表的超键。如:(学号)、(学号,姓名)、(身份证号,性别)等。
候选键:
候选键属于超键,它是最小的超键,就是说如果再去掉候选键中的任何一个属性它就不再是超键了。学生表中的候选键为:(学号)、(身份证号)。
主键:
主键就是候选键里面的一个,是人为规定的,例如学生表中,我们通常会让“学号”做主键,教师表中让“教师编号”做主键。
外键:
外键比较简单,学生表中的外键就是“教师编号”。外键主要是用来描述两个表的关系。
For instance:
3、RA and SQL
3.1 Relational Algebra
Relational algebra is a collection of operations that are used to manipulate the entire set of relations.
The output of any relational algebra operation is always a relation.
Union
(-) Difference
Intersection
Cartesian Product(X)
SELECT operation
Projection Operation
join
Theta Join
EquiJoin
natural join
三种join
Division()
拿整个被除对应另一些属性
examples
还有下篇