当前位置:网站首页>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
)
);
边栏推荐
- Analysis of contentvalues
- [CTF attack and defense world] questions about backup in the web area
- Cannot find a valid baseurl for repo: HDP-3.1-repo-1
- 深度学习汇报(2)
- Iptables detailed explanation and practical cases
- adb.exe已停止工作 弹窗问题
- Rabbit learning notes
- 李宏毅机器学习(2017版)_P13:深度学习
- 6. 世界杯来了
- Play guest cloud with zerotier nanny level teaching to ensure learning waste
猜你喜欢

腾讯升级视频号小程序直播功能,腾讯持续推广直播的底气是这项叫视立方(MLVB)的技术

Jenkins--基础--04--安装中文插件

Li Hongyi machine learning (2017 Edition)_ P21: convolutional neural network CNN

玩客云搭配zerotier保姆级教学,保证学废

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

Small programs related to a large number of digital collections off the shelves of wechat: is NFT products the future or a trap?

Jenkins -- Basic -- 5.3 -- system configuration -- global security configuration
#问题反馈 手机 app 同步失败:数据仓库外部变更损坏 ipad app 也是一打开就下载仓库,然后闪退

Doris or starrocks JMeter pressure measurement

Play guest cloud brush machine 5.9
随机推荐
pytorch张量数据基础操作
浅析ContentValues
In depth learning report (2)
Jenkins--基础--5.1--系统配置--插件管理
最长公共子串
什么是数字经济,它是如何改变商业模式的?
SQL learning (2) -- basic query and sorting of tables
Redis -- cache avalanche, cache penetration, cache breakdown
游戏项目导出AAB包上传谷歌提示超过150M的解决方案
Li Hongyi machine learning (2017 Edition)_ P13: deep learning
07 - setup and attack of log server
Jenkins--基础--5.2--系统配置--系统配置
下一代互联网:视联网
SQL学习(1)——表相关操作
Android——LitePal数据库框架的基本用法
The setup of KEIL development environment is delivered to the installation package
Small programs related to a large number of digital collections off the shelves of wechat: is NFT products the future or a trap?
10 - deploy MySQL on CentOS 7
微信大量下架数字藏品相关小程序:NFT产品究竟是未来还是陷阱?
Deep understanding of pod objects: basic management