MySQL Learning (ii)

Source: Internet
Author: User

Connection query:

1, connection above table 2, connection conditions

Left JOIN connection:

Select column 1, ... TableA left join TableB on tableA. Column = TableB. column where group by,having write as usual

[When connected to a large table, you can act as a table]

Slect goods_id, Goods.cat_is,cat_name,shop_price from goods left join category on goods.cat_id=category.cat_id

Right connection:

Select column 1, ... tableA right joins TableB on tableA. Column = TableB. Column where group By,having writes as usual

Internal connection:

Select column 1, ... tableA inner join TableB on tableA. Column = TableB. column where group by,having write as usual

The difference between left join, right connection and inner connection:

Left join: Take the left table as the quasi, go to the right table to find matching data, can not find matching with null;

Right connection: Whichever is the right table,

Internal connection: Query the left and right table data, that is, the part that does not have null.

Trigger: Trigger monitors a situation that triggers a certain action;

Trigger creation Syntax four elements: 1. Monitoring location (table) 2. Monitoring Events (Insert/update/delete) 3. Trigger Time (After/before) 4. Trigger Event (Insert/update/delete)

Transaction:

Open transaction Start transaction;

Execute SQL statement

Commit a transaction commit; /Roll back rollback;

MySQL Learning (ii)

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.