前提:想起总结这个东西已经距离考试结束很久了,笔记很多细节描述的不太清晰,很多地方也忘记了,有问题的地方也欢迎大家及时提出来!!
目录:
• Block 1
– Introduction 介绍
– Relationalmodel 关系模型
– RelationalAlgebra 关系代数
– Entity Relationship(ER) modelling 实体关系建模
• Block 2
– EER modelling 强化实体关系建模
– ER toRelational Model mapping ER与EER建立关系模型图
– SQL 语言
– Database design
• Block 3
– Normalization
– AdvancedNormalization
– Transactionmanagement
• Block 4
– DistributedDBMS
– XML
– NoSQL
DreamHome举例:是一个书中的关系模型,老师的课程中和平时的举例中很多都是使用的这个关系模型
![](https://img-blog.csdnimg.cn/img_convert/fc93df6e4fb4de177617641a565613ea.png)
Block 1
Introduction
![](https://img-blog.csdnimg.cn/img_convert/be8387b9c355b81f3e386e303a8e3ec1.png)
Relational Model and Relational Algebra
基础知识:
• Relation(关系): A relation is a table with columns and rows. 包含行和列的表
• Attribute(属性):An attribute is a named column of a relation. 关系的命名列
• Domain(域): the set of allowable values for one or more attributes. 一个或多个属性的允许值集
• Tuple(元组): A tuple is row of a relation. 关系的行
• Degree(度): the number of attributes in a relation. 关系中属性的数量
• Cardinality(基数): the number of tuples in a relation. 关系中的元组数
• Relational database(关系数据库): A collection of normalized relations with distinct relation names
![](https://img-blog.csdnimg.cn/img_convert/cf6ea2676754e60d83e645452b10ffc7.png)
Relational keys(关系键)重要!!!
• Candidate Key 候选键(考试必考的东西,一定要掌握,PS:虽然理解起来有点困难)
– A set of attributes that uniquely identifies a tuple within arelation.
– Uniqueness : In each tuple, candidate key uniquely identify thattuple.
– Irreducibility: No proper subset of the candidate key has theuniqueness property.
可唯一标识某一元组的属性组,属性组中各个属性缺一不可。【t_student】(学号,姓名,学院),姓名可能会重复,所以其中学号可以唯一标识一条记录,学号就是t_student的候选键。那么假设姓名不会重复,那么候选键就有学号和姓名两个。又比如【t_grade】(学号,课程,成绩),其中一个学生可以有多条成绩记录,所以需要学号和课程号组合才可以唯一标识一条数据库记录,所以学号、课程号就是t_student的一个候选键。
• Primary Key 主键
– Candidate key selected to identify tuples uniquely with in relation.
只要一个属性组可以唯一标识一个元组,那么就说这个属性组是超键 【t_student】(学号,姓名,学院),姓名可能会重复,所以(学号)是一个超键同时也是候选键,(学号,姓名)可唯一标识一个元组,所以其也是超键,但不是候选键,因为少了姓名也可以唯一标识。
• Foreign Key 外键
– Attribute, or set of attributes, within one relation that matches candidate key of some other(possibly same) relation.
对于Domains的举例:
![](https://img-blog.csdnimg.cn/img_convert/9f912b0826ef0929e1670dc0bffbd355.png)
![](https://img-blog.csdnimg.cn/img_convert/1b81e5e6f3c1912aae438125973cfdf1.png)
![](https://img-blog.csdnimg.cn/img_convert/f4af26207664314d77ac5fde65dfd9a7.png)
![](https://img-blog.csdnimg.cn/img_convert/599cecad96cf45fb97b7f544f3960b70.png)
一些关于关系代数的练习题
![](https://img-blog.csdnimg.cn/img_convert/543db89003b302ac50c72702478eac21.png)
![](https://img-blog.csdnimg.cn/img_convert/9da002767540b87b490eb0bbb46c9a11.png)
![](https://img-blog.csdnimg.cn/img_convert/586ab2a2235819006895de5268548fba.png)
Block 2
![](https://img-blog.csdnimg.cn/img_convert/ae9e30da109510a2997245b32c004774.png)
![](https://img-blog.csdnimg.cn/img_convert/0cd6fd2dce417b6a32bf2f94bfbf30f9.png)
![](https://img-blog.csdnimg.cn/img_convert/796aed00f2af12d6791a193350bbe2b9.png)
![](https://img-blog.csdnimg.cn/img_convert/5bf2b2b7ca5fdb5126e6422c8f5148b4.png)
![](https://img-blog.csdnimg.cn/img_convert/a0f9c0db716e1867c130cf77cd3ff383.png)
![](https://img-blog.csdnimg.cn/img_convert/fdd1df9fb328a048df8cd72c0be435ac.png)
![](https://img-blog.csdnimg.cn/img_convert/0215ea48b73cda8b7f2655dc9a95941f.png)
![](https://img-blog.csdnimg.cn/img_convert/498308de8ba9f68ab111284b7efea007.png)
![](https://img-blog.csdnimg.cn/img_convert/2e15f5bc28b9a220a40ff52fdd3a0357.png)
![](https://img-blog.csdnimg.cn/img_convert/4efea5e5ab1e403094610afede504e5d.png)
![](https://img-blog.csdnimg.cn/img_convert/9e64f9e52724884cd9f05ca8784166df.png)
![](https://img-blog.csdnimg.cn/img_convert/9dd32eddb0850a3c713266aeac377e56.png)
![](https://img-blog.csdnimg.cn/img_convert/e284eecab4c5d94723cea5ab0da909c7.png)
![](https://img-blog.csdnimg.cn/img_convert/3673175746eab59ec52b979bd77758d3.png)
![](https://img-blog.csdnimg.cn/img_convert/8ad839099f6d7221a524900397f4dcba.png)
![](https://img-blog.csdnimg.cn/img_convert/d01d87408dcf9032a544ac43b3d2f873.png)
![](https://img-blog.csdnimg.cn/img_convert/453c0422b41fab5491b98bbae529518e.png)
![](https://img-blog.csdnimg.cn/img_convert/b5a216fca533c2d1914e1d037a49fc85.png)
![](https://img-blog.csdnimg.cn/img_convert/ab989b05b8dbb6b71132fd1d080351ce.png)
![](https://img-blog.csdnimg.cn/img_convert/414a91eb56186921f32141ecb6d2ec6e.png)
Block 3
![](https://img-blog.csdnimg.cn/img_convert/f6953757378b30c6178f10f6deca7100.png)
![](https://img-blog.csdnimg.cn/img_convert/e245180f8b244ff02f9b716e21d3c64a.png)
![](https://img-blog.csdnimg.cn/img_convert/d78bc510088a9f6fd40383f321e5a6fd.png)
![](https://img-blog.csdnimg.cn/img_convert/7e0114ce57bb508cb1bf6efd1589e7cb.png)
![](https://img-blog.csdnimg.cn/img_convert/92682c261b1a1848a42ec93a0d0b3707.png)
![](https://img-blog.csdnimg.cn/img_convert/68c98254a6e31de5faf8adfa9092c40d.png)
![](https://img-blog.csdnimg.cn/img_convert/652801404fc06b88f1b5ded57481642c.png)
![](https://img-blog.csdnimg.cn/img_convert/d0ce6e3de18449b84705435a887eb89b.png)
![](https://img-blog.csdnimg.cn/img_convert/4b3ec8943f12c2cdb8a6799c8433a781.png)
![](https://img-blog.csdnimg.cn/img_convert/4f945a2016d9a8cef4aead4cc81c2986.png)
![](https://img-blog.csdnimg.cn/img_convert/8cd09c17c079d38f08f34f31ecda84d1.png)
![](https://img-blog.csdnimg.cn/img_convert/9b5bdcbd6ca5c8a454dbc75c0122a3d1.png)
![](https://img-blog.csdnimg.cn/img_convert/214d22034165c1ff7b1059b5bdda5b59.png)
Block 4
![](https://img-blog.csdnimg.cn/img_convert/0100980b183c26a66e18f3e326373833.png)
![](https://img-blog.csdnimg.cn/img_convert/f5dbb3db0ea104416bbe6896f59c8177.png)
![](https://img-blog.csdnimg.cn/img_convert/0a8ecf05d4e7a6017c59b4c7b12664b3.png)
![](https://img-blog.csdnimg.cn/img_convert/d3edd8a50b657a745abaa26746c6b4b9.png)
![](https://img-blog.csdnimg.cn/img_convert/512b404942a83d31ef70a35dae944ccc.png)
![](https://img-blog.csdnimg.cn/img_convert/405eae0e17d5fdb66b412c267090068f.png)
![](https://img-blog.csdnimg.cn/img_convert/fe388e06c7dff4d87919df5219789ed3.png)
![](https://img-blog.csdnimg.cn/img_convert/22f2a1dbce24c42fb6b949fbab49752c.png)
![](https://img-blog.csdnimg.cn/img_convert/cfd50808b00aec74e9c2c677ece339c2.png)
![](https://img-blog.csdnimg.cn/img_convert/8a3a6a6fb00e48100517b8cce3c8daaa.png)
![](https://img-blog.csdnimg.cn/img_convert/14ce7f79eef0e22fa10526a9aa78cd67.png)
![](https://img-blog.csdnimg.cn/img_convert/82906ba8483ed43fee452329352931db.png)
![](https://img-blog.csdnimg.cn/img_convert/5a33997f41d1cc9fbdd1aee0aaf23e22.png)
![](https://img-blog.csdnimg.cn/img_convert/59af4a7fadf25a34d4e722816e0c529c.png)
![](https://img-blog.csdnimg.cn/img_convert/20a39dcd03cb6222399753a24c5b2cf4.png)
由于期末比较紧张,Block4的部分总结的不是很全,详细内容还是参考一下老师的ppt吧
需要总结的pdf文件可以私信我