View:
create [or replace] [algorithm ={undefined|merge|temptable}]
View View_name [(column_list)]
As Select_statement
[With [cascaded|local] Check option]
Replace replaces the view you have created
algorithm for algorithm view selection
Undefind MySQL will automatically select the algorithm
Merge merges the view statement used with the view definition so that some part of the view definition supersedes the part of the statement
TempTable The result of the view into a temporary table, and then executes the statement with a temporary table
View_name The name of the view
column_list as attribute column
Select_statement represents the select statement
The WITH [cascaded|local] Check Option parameter indicates that the view is guaranteed to be within the view's permission range when updating
cascaded is the default value, indicating that the view is updated so that the conditions of the associated view and table are met
Local means that when the view is updated, the conditions defined by the view itself are met
To view the view:
Desc view_name;
To view basic information about a view:
Show table status like ' view name ';
To view more information about a view :
Show CREATE VIEW name ;
Viewing View details in the Views table
SELECT * from Information_schema.views;
To modify a view:
Create or Replace view statement modification
Or:
alter [Algorithm ={undefined|merge|temptable}]
View View_name [(column_list)]
As Select_statement
[With [cascaded|local] Check option]
To update the view:
Insert Update Delete statement operation view as Table
To delete a view:
Drop view [if exists]]
View_name[.view_name] ...
[Restrict|cascade]
Learning Notes-mysql_ View