Seven types of Join for MySQL

Source: Internet
Author: User

Create a table

Fast to the end

Student table

Create TableStudent (IDint( One) not NULLauto_increment, namevarchar( -), Addressvarchar( +),  Primary Key(ID)) engine=InnoDB CharSet=UTF8;INSERT  intoStudent (name,address)VALUES('Tiankai Zhi','Tianchang, Anhui province');INSERT  intoStudent (name,address)VALUES('Tau','Tongling, Anhui province');INSERT  intoStudent (name,address)VALUES('Shi Dongdong','Anqing, Anhui province');INSERT  intoStudent (name,address)VALUES('Wei Zhong Original','Chuzhou, Anhui province');INSERT  intoStudent (name,address)VALUES('Tian Eternal','Fuyang, Anhui province');INSERT  intoStudent (name,address)VALUES('Bear Play','Tianchang, Anhui province');

Score Table

Create TableChengji (IDint( One) not NULLauto_increment, Socrefloat(5,2),  Primary Key(' id ')) engine=InnoDB CharSet=UTF8;INSERT  intoChengji (Socre)VALUES(95.54);INSERT  intoChengji (Socre)VALUES(124.4);INSERT  intoChengji (Socre)VALUES(130.0);INSERT  intoChengji (Socre)VALUES(135);INSERT  intoChengji (Socre)VALUES(149.547);INSERT  intoChengji (Id,socre)VALUES(7, $);

Links within

Inside link Venturi diagram

Left outer connection

Left outer connection Venturi diagram

Right outer connection

Right outer connection Venturi diagram

Left connection

Left join to the Venturi diagram

Right connection

right connect to the Venturi diagram

Fully connected

Fully connected Venturi diagram

Remove intersection

Venturi diagram

Seven types of Join for MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.