View
A view is a virtual table (not a real one), which is essentially "getting a dynamic dataset from an SQL statement and naming it", which allows the user to get a result set using only "name" and use it as a table.
Temporary table Search
Select *from ( Select nid, NAME from tb1 WHERE nid > 2 ) as Awhere A. NAME > ' Alex ';
1. Create a View
--Format: CREATE VIEW name as SQL statement CREATE VIEW v1 as Selet nid, namefrom awhere nid > 4
2. Delete View
--Format: Drop View Name Drop View V1
3. Modify the View
--format: ALTER VIEW name as SQL statement alter VIEW v1 asselet A.nid, B. namefrom Aleft Join B on a.id = B.nidleft Join C on a.ID = C.nidwhere a.id > 2AND C.nid < 5
4. Using views
When you use a view, you manipulate it as a table, and because the view is a virtual table, you cannot use it to create, update, and delete real tables, only for queries.
SELECT * FROM v1
Trigger
Before and after an "Add/delete/change" operation on a table if you want to trigger the behavior of a feature, you can use a trigger that customizes the behavior of the user before and after the "Add/delete/change" row of the table.
MySQL (ii)