https://zhuanlan.zhihu.com/p/27330413
关系运算:
基本运算
传统运算
1 | A->B 不满足 |
1 | 学号课号决定教师 |
1 | 候选键:邮编+街道名 |



对
考试题目

顾客ID+商品ID+交易时间
3NF
非主属性对码的传递依赖
AB->C C->D,AB->D
2NF,非主属性部分依赖于主属性 D依赖于E
1NF,存在非主属性对码的部分依赖


BCNF必须保证决定因素都是候选码,而不是主属性
所有属性都是主属性







波浪线表示外键

关键属性不要忽略,非关键属性可以不忽略
关系范式 规范化分析


考试重点不是写过程,恢复以后的值是多少
读到未提交,并且回滚的数据,是脏数据。
不可重复读

(1)冗余,删除材料的时候,会出现删除异常,插入的时候,没有材料号无法删除
(2)工程号–>开工日期,完工日期
材料号->f(价格)
主键(工程号,材料号)
第二范式,非主属性对码的部分函数依赖
R1(工程号,开工日期,完工日期)
R2(材料号,价格)
R3(工程号,材料号,数量)