views and base tables vs views and select
Only a SELECT statement is saved in the view, and the source data is from the base table Check View
When you update the base table data by checking the view, only the update statements that meet the check criteria can be executed successfully.
Local Check View
When you check the view to update a table, the UPDATE statement can be performed correctly only if the view's check condition is met. (The value of with_check_option is 1)
When you update a table through a cascading view, only update statements that meet all the checks for all views of that view will execute correctly. (The value of With_check_option is 2) trigger events and time in MySQL
Trigger event has 3 insert Update Delete
The trigger time has 2 kinds of before after the use of triggers the SELECT statement in the trigger cannot return a result set the same table cannot create two trigger programs that trigger events cannot use transaction-related statements ( Start Transaction,commit,rollback and so on) MySQL triggers operate on records, and when you batch update data, introducing triggers can lead to a reduction in the performance of bulk update operations. In the MyISAM engine, triggers do not guarantee atomicity. And in the InnoDB, you can. When the InnoDB storage engine implements an external health constraint relationship, you can use the cascading options to maintain the external health data, whereas in MyISAM you can use triggers to implement cascading modifications and deletions. The MySQL trigger cannot perform an update operation on this table. In the Before trigger, the new value from the growing field is 0, not the self-added field value that is automatically generated when the record is actually inserted. Temporary Tables
As a derived table for the main query, in order to complete the query, temporary tables need to be created automatically to store the temporary result set, which is created by MySQL itself, maintained by itself, called the Automatically created temporary table view, subquery, temporary table, derived table
Views are usually used in the FROM clause of a subquery statement, and the subquery is used in the WHERE clause or the HAVING clause of the main query.
If the statement of the main query for the view is update, delete, insert, and the main query executes an update operation for a specific field, the main query statement will be faulted.
A derived table has a shorter life cycle than a temporary table, and the derived table is cleared immediately after the execution of this SELECT statement.