当前位置:网站首页>SQL relational algebra - Division
SQL relational algebra - Division
2022-07-27 01:18:00 【lzl_ 0408】
How to understand division in relation
Definition : Set up a relationship R Divide by relation S The result is relationship T, be T Include all in R But not in S Properties and their values in , And T Of Tuples And S All combinations of tuples of are in R in

There's a relationship R,S as well as RS, As shown in the figure , seek RS÷S Result

It is easy to get the result as :{ Zhang San }
So you can easily see RS÷S The problem to be solved here is :“ Get students who have taken all courses ”
RS÷S Is that :“ stay R and S The connection of RS in , Find out and S All tuples in are related R Tuples ”.
R(X,Y)÷S(Y,Z) The operation of is in structured language SQL The statement can be expressed in the following form :
select distinct R.X from R as R1
where not exists
(
select S.Y from S
where not exists
(
select* from R as R2
where R2.X = R1.X and R2.Y = S.Y
)
);
边栏推荐
- x 的平方根
- How can Tencent cloud live plug-in mlvb make use of these advantages to become the divine assistant of anchor Live Streaming?
- 李宏毅机器学习(2021版)_P5-6:小梯度处理
- 25 common questions in Flink interview (no answer)
- 力扣刷题量300记录帖
- 5. Xshell connection server denied access, password error
- onSaveInstanceState和onRestoreInstanceState方法的调用
- adb. Exe stopped working popup problem
- 并发编程之生产者消费者模式
- The difference between forward and redirect
猜你喜欢

VIS工作流 - PlantCV

adb. Exe stopped working popup problem

How can Tencent cloud live plug-in mlvb make use of these advantages to become the divine assistant of anchor Live Streaming?

李宏毅机器学习(2021版)_P5-6:小梯度处理

集中式版本控制工具代码合并问题

Simple explanation of database table connection

Jenkins--基础--5.3--系统配置--全局安全配置

Come and help you understand the mobile Internet in a minute

快来帮你三分钟了解物联网

Use Tika to judge the file type
随机推荐
物联网改善我们生活的 6 种方式
Flinksql window triggered in advance
Jenkins--基础--5.3--系统配置--全局安全配置
初中高三部曲音视频下载Pronunciation Pairs+Ship or Sheep+Tree or Three
并发编程之生产者消费者模式
The difference between forward and redirect
SQL学习(1)——表相关操作
The dependency of POM file is invalid when idea imports external projects. Solution
Analysis of contentvalues
10 - deploy MySQL on CentOS 7
Rabbit learning notes
Li Hongyi machine learning (2017 Edition)_ P6-8: gradient descent
MTCNN
力扣刷题量300记录帖
onSaveInstanceState和onRestoreInstanceState方法的调用
非递归前中后序遍历二叉树
How to open ads for profit after uni app develops apps and plug-ins: uni ad
Jenkins -- Basic -- 5.2 -- system configuration -- system configuration
4.root用户登录
5.xshell连接服务器拒绝访问,密码错误