MySQL Connection Query Learning notes

Source: Internet
Author: User

#交叉连接 (return to Cartesian intersection)
axb={(b) |a belongs to A and b belongs to B}, then the set formed by AXB is called the Cartesian set

1 SELECT *  from  Cross Join depts; 2 SELECT *  from Employees,depts;

#内连接 (Only records that meet the join condition are returned, and records that do not meet the join condition are not returned)

1 Select *  from INNER Join  2on= t2.dept_id;

#右外连接 (not only records that meet the join condition are returned, but records that do not meet the join condition are returned, but no records are returned from the table that do not meet the join criteria)

1 Select *  from  Right Join  2on= t2.dept_id;

#左外连接 (not only records that meet the join condition are returned, but records that do not meet the join condition are returned, but no records are returned from the table that do not meet the join criteria)

Select *  from  Left Join  on= t2.dept_id;

SELECT t1.name ' employee name ', T2.name ' department ' from employees T1

1  Left Join  on = t2.dept_id;

MySQL Connection Query Learning notes

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.