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)