当前位置:网站首页>SQL exercise set
SQL exercise set
2022-07-27 09:07:00 【Masike 1024】
The first question is :on Back heel and and where The difference between
The table structure is as follows :
CREATE TABLE `a` (
`id` int(11) NOT NULL,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `a` VALUES (1, 'a');
INSERT INTO `a` VALUES (2, 'b');
INSERT INTO `a` VALUES (3, 'c');
CREATE TABLE `b` (
`id` int(11) NOT NULL,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `b` VALUES (1, ' nail ');
INSERT INTO `b` VALUES (2, ' B ');
SQL1:SELECT a.*,b.* FROM a LEFT JOIN b on a.id = b.id; The execution result is :
+----+------+------+------+
| id | name | id | name |
+----+------+------+------+
| 1 | a | 1 | nail |
| 2 | b | 2 | B |
| 3 | c | NULL | NULL |
+----+------+------+------+
SQL2:SELECT a.*,b.* FROM a LEFT JOIN b ON a.id = b.id AND b.id=2; The execution result is :
+----+------+------+------+
| id | name | id | name |
+----+------+------+------+
| 1 | a | NULL | NULL |
| 2 | b | 2 | B |
| 3 | c | NULL | NULL |
+----+------+------+------+
SQL3:SELECT a.*,b.* FROM a LEFT JOIN b ON a.id = b.id WHERE b.id=2; The execution result is :
+----+------+------+------+
| id | name | id | name |
+----+------+------+------+
| 2 | b | 2 | B |
+----+------+------+------+
Summary :
1.on For later conditions and, Whether the conditions are true or not, all the data in the left table will be displayed .
2.on For later conditions where, stay left join Filter based on the generated table , At this time, I will put where Filter out those that are not established in .
The second question is :…
边栏推荐
- B tree
- PVT的spatial reduction attention(SRA)
- Antdesign a-modal自定义指令实现拖拽放大缩小
- vscod
- Specific methods and steps for Rockwell AB PLC to establish communication with PLC through rslinx classic
- Aruba学习笔记10-安全认证-Portal认证(web页面配置)
- MySQL基础知识学习(一)
- Matlab drawing skills and examples: stackedplot
- Storage and computing engine
- Activation functions commonly used in deep learning
猜你喜欢

8 kinds of visual transformer finishing (Part 2)

Understand various IOU loss functions in target detection

ctfshow 终极考核

对 int 变量赋值的操作是原子的吗?

Mangodb simple to use

Mmrotate trains its dataset from scratch
![[flutter -- geTx] preparation](/img/5f/96075fa73892db069db51fe789715a.png)
[flutter -- geTx] preparation

npm install报错 强制安装

Low cost, low threshold, easy deployment, a new choice for the digital transformation of 48 million + small and medium-sized enterprises

vscod
随机推荐
Specific methods and steps for Rockwell AB PLC to establish communication with PLC through rslinx classic
CUDA programming-01: build CUDA Programming Environment
Unity3d 2021 software installation package download and installation tutorial
Rewrite the tensorrt version deployment code of yolox
MATLAB data import -- importdata and load functions
Can "Gulangyu yuancosmos" become an "upgraded sample" of China's cultural tourism industry
BOM的常用操作和有关获取页面/窗口高度、宽度及滚动的兼容性写法
Data interaction based on restful pages
5g failed to stimulate the development of the industry, which disappointed not only operators, but also mobile phone enterprises
Deep understanding of Kalman filter (3): multidimensional Kalman filter
对 int 变量赋值的操作是原子的吗?
Matlab画图技巧与实例:堆叠图stackedplot
Encountered 7 file(s) that should have been pointers, but weren‘t
[daily algorithm 94] classic interview question: motion range of robot
Test picture
1.3.1 Full Permutation Problem
async/await的执行顺序以及宏任务和微任务
linux下安装oracle,本地PL/SQL连接Linux下的oracle导入表并新建用户和密码
tensorflow包tf.keras模块构建和训练深度学习模型
CUDA programming-04: CUDA memory model