当前位置:网站首页>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 .
边栏推荐
- Influence and requirements of different manufacturing processes on the pad on PCB
- com. alibaba. fastjson. Jsonobject tojsonstring eliminate circular reference
- MySQL 索引测试
- Iris, the web framework of go
- CTF流量分析常见题型(二)-USB流量
- A common mistake in enterprise model selection
- 配置服务器环境
- Temperature measuring instrument based on STM32 single chip microcomputer
- ANSI/UL 94 5-V级垂直燃烧试验
- Teach you how to write selenium test cases
猜你喜欢

Gateway服务网关

美国服务器租用和托管服务哪个好?

Some interesting modules

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

Huaxing Securities: kitex practice under the original hybrid Cloud Architecture

项目配置了eslint,编辑器没有关闭eslint功能的情况下,eslint没有生效

Swin-transformer --relative positional Bias

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

3.10 haas506 2.0 development tutorial example TFT

Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
随机推荐
如何使用物联网低代码平台进行服务管理?
MQ优缺点(2022.5.2-5.8)
How to configure webrtc video stream format playback in the new version of easygbs?
Memory Limit Exceeded
Development: how to install offline MySQL in Linux system?
「干货」数据分析常用的10种统计学方法,附上重点应用场景
CTF流量分析常见题型(二)-USB流量
Unity technical manual - preliminary performance optimization
为什么越来越多的人选择云渲染?
The folder is transferred between servers. The folder content is empty
Personally test the size of flutter after packaging APK, quite satisfied
Entry node of link in linked list - linked list topic
Trust configuring domestic sources
微信小程序快速入门 --项目介绍
Coding officially entered Tencent conference application market!
10 statistical methods commonly used for "dry goods" data analysis, with key application scenarios attached
全技术栈、全场景、全角色云原生系列培训重磅首发,助力企业打造硬核云原生技术团队
German agbb VOC hazardous substances test
Large file transfer software based on UDP protocol
sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户