Connection between left and right of mysql and internal connection of cainiao
1. create a table: boy and insert several lines of data. Java code: create table boy (
Name varchar (10 ),
Flower varchar (10)
); Java code insert into boy
Values
("Lin shuhao", "Rose "),
("Liu Xiang", "Peach Blossom "),
("Jay Chou", "Jasmine "),
("Sharp brother", "Lotus "),
("Andy Lau", "dog tail flower ");
2. create a table: girl and insert several rows of data. Java code: create table girl (
Name varchar (10 ),
Flower varchar (10)
); Java code insert into girl
Values
("Avier", "Rose "),
("Mrs Curie", "Peach Blossom "),
("Sister Furong", "Jasmine "),
("Fengjie", "Jasmine "),
("Lin Zhiling", "Lotus ");
3. test:
Note: In the left join, how many rows are there in the table? Neither the number of rows in the boy table nor the number of rows in the girl table, nor the number of rows in the boy table multiplied by the number of rows in the girl table, is determined by the on condition. But it must be greater than or equal to the number of rows in the left table. For example, if there is no matching match on the right, use null to complete the match in the girl table.
Differences between left and right connections:
A stands on the left of B = B stands on the right of.
A left join B = B right join.
Internal Connection:
Query all data in both the left and right tables.
The inner connection is the intersection of left and right connections.