The first is to create the view
CREATE algorithm=undefined definer= ' root ' @ ' localhost ' SQL SECURITY definer
VIEW ' New_view '
As (select ' Girls ') ' id ' as ' id ', ' Girls '. ' Name ' as ' name ', ' Girls '. ' Age ' as ' age ', ' girls ', ' level ' as ' level ' from ' Girls ';
The red code is automatically generated by MySQL,
The SQL that creates the view generally is as follows
The name of the CREATE View view
As (SELECT * from table name)
And then I'm going to focus on this essay, and that's what I've been trying to do. If the data is changed, the data of the view will change automatically.
And then I did the test, and the result is
The data in the MySQL view changes according to the data of the corresponding table, and is automatically completed .
MySQL view, view created, will automatically change the data as the table changes