(整理中)数据库理论笔记

1、自然连接(R▷◁S)
符号下面啥关系符号也没有的,默认为将两方相同属性进行比较,留下属性值相同的元组。
(元组为行的意思)

2、除运算(R÷S)
将R表中S表未有的属性投影,每个值取两表相同属性的集合的象集。将S表取出两表相同属性的集合的象集。若R表上述投影某元组包含S表所有上述集合的象集,则将其投影取出作为结果。
(将某一元组的某几个属性的值得集合作为一个值,n个元组可得n个值,值的集合为象集)

3、mysql不支持authorization

4、注释一行 --空格 – create schema safd;

5、快捷键

  1. ctrl + 回车 运行所在行语句
  2. ctrl + shift + 回车 运行选中语句
  3. ctrl + b 自动排版语句
  4. ctrl + / 添加 '-- ’
  5. ctrl + l 删除本行
  6. ctrl + f 寻找
  7. ctrl + h 替换
  8. ctrl + [ 跳到上一语句
  9. ctrl + ] 跳到下一语句
  10. ctrl + | 跳到下一单词
  11. ctrl + t 创建新语句窗口

6、用not exists实现全称量词
题目:找到选修所有课程的学生姓名
转换:没有一门课程他不选修
sql程序:select sname from student where not exists (select * from course where not exists (select * from sc where sno=student.sno

猜你喜欢

转载自blog.csdn.net/qq_36769966/article/details/108489672