当前位置:网站首页>MySQL - table join and join

MySQL - table join and join

2022-06-21 13:36:00 Longbow dog learning C

1. Internal connection

Internal connection is to use where Clause to filter the Cartesian product formed by two tables .( The following figure is the Cartesian product )

 

The understanding of bloggers here is to use the two fields to filter together , Then the intersection of the two data is obtained .

  The following is the standard inner join writing

 

 2. External connection

2.1. The left outer join

Let's first create a student table and a grade table

  Joint query The table on the left completely shows the left outer connection , We can see that the second one is the left outer connection

 2.2 Right connection

  Joint query right The table on the side shows the right outer connection

2.3 How to distinguish the left table , Right table

We try to exchange the writing order of the two tables and get the following figure , We know that the first one to be written is the left table , The following is the right table . 

原网站

版权声明
本文为[Longbow dog learning C]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221438094873.html