当前位置:网站首页>Task04: set operation - addition and subtraction of tables, join, etc. - learning notes of Tianchi Longzhu project SQL training camp
Task04: set operation - addition and subtraction of tables, join, etc. - learning notes of Tianchi Longzhu project SQL training camp
2022-06-30 19:29:00 【Game programming】
Tips : When the article is finished , Directories can be generated automatically , How to generate it, please refer to the help document on the right
Preface
This chapter is about the Tianchi dragon ball project SQL Training camp Task04 Lesson notes , About SQL Set operations - Addition and subtraction of tables join And so on .
One 、 The addition and subtraction of tables
1. What is set operation
Sets represent... In the field of mathematics “ The sum of all kinds of things ”, Represents a collection of records in the database domain . say concretely , surface 、 The execution results of views and queries are collections of records , The elements are each row in the table or query results .
In standard SQL in , Use... For the search results respectively UNION, INTERSECT, EXCEPT To search the results and , Intersection and difference operations , image UNION,INTERSECT, EXCEPT This kind of operator used for set operation is called set operator .
Two 、 Link (JOIN)
1. Inner link (INNER JOIN)
The syntax format of the inner link is :
– Inner link
FROM <tb_1> INNER JOIN <tb_2> ON <condition(s)>
2. External links (OUTER JOIN)
— The inner link will discard the unsatisfied in the two tables ON The conditions are right , The opposite of the inner link is the outer link . The outer link will selectively keep the unmatched rows according to the type of outer link .
According to which table the reserved rows are located , There are three forms of external links : Left link , Right link and all outer link .
The left link will be saved and cannot be followed in the left table ON Clause matches to the line , At this time, the rows corresponding to the right table are all missing values ; The right link will save the right table, which cannot be followed ON Clause matches to the line , At this time, the rows corresponding to the left table are all missing values ; The total external join will save two tables at the same time ON Clause matches to the line , The corresponding row in another table is filled with missing values .
The corresponding grammars of the three external links are :
– Left link
FROM <tb_1> LEFT OUTER JOIN <tb_2> ON <condition(s)>
– Right link
FROM <tb_1> RIGHT OUTER JOIN <tb_2> ON <condition(s)>
– All external links
FROM <tb_1> FULL OUTER JOIN <tb_2> ON <condition(s)>
summary
That's what we're going to talk about today , This article only briefly introduces the set operation 、 Definition of intra table connection and outer table connection .
author : Yu xiaoxiaoxiaoyu
Game programming , A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
边栏推荐
- The cloud native landing practice of using rainbow for Tuowei information
- Some interesting modules
- 嵌入式软件开发新趋势:DevOps
- Word -- a solution for word to encounter errors when trying to open a file
- rust配置国内源
- js 字符串截取方法汇总
- NBI visual platform quick start tutorial (V) introduction to editor functions and operations
- 如何使用物联网低代码平台进行服务管理?
- ros advertise 发布数据小技巧--latch配置
- LinkedList的简单用法(2022.6.13-6.19)
猜你喜欢

ArcGIS no plug-in load (no offset) day map

4个技巧告诉你,如何使用SMS促进业务销售?

Pytorch learning (III)

在广州的朋友,有机会可以参加下

Redis beginner to master 01

全技术栈、全场景、全角色云原生系列培训重磅首发,助力企业打造硬核云原生技术团队

Personally test the size of flutter after packaging APK, quite satisfied

Pyth-Solana链上联通现实的桥梁

Entropy - conditional entropy - joint entropy - mutual information - cross entropy

虚拟主机什么时候适合更换成云主机?
随机推荐
Kalman filter -- Derivation from Gaussian fusion
Develop those things: how to add text watermarks to videos?
连接实验室服务器
在广州的朋友,有机会可以参加下
如何使用物联网低代码平台进行服务管理?
年复一年,为什么打破数据孤岛还是企业发展的首要任务
mysql函数获取全路径
开发那些事儿:Linux系统中如何安装离线版本MySQL?
Evolution of screen display technology
Entropy - conditional entropy - joint entropy - mutual information - cross entropy
ArcGIS no plug-in load (no offset) day map
嵌入式软件开发新趋势:DevOps
Kalman滤波器--从高斯融合推导
Personally test the size of flutter after packaging APK, quite satisfied
法国A+ 法国VOC标签最高环保级别
Large file transfer software based on UDP protocol
Pyth-Solana链上联通现实的桥梁
CTF流量分析常见题型(二)-USB流量
商业智能BI与业务管理决策思维之四:业务成本分析
JS 如何正确清除一个元素下的所有子元素