Detailed description of the Mysql view, detailed description of the Mysql View
View:
In mysql, views are similar to tables. Views are composed of several fields and several records. Views can also be used as data sources for select statements.
Only a select statement is saved in the view. The definition of the view is saved, and real data is not saved. The source data in the view comes from the database table. The database table is called the basic table or base table, and the view is called the virtual table.
1. Create a view
The syntax format for creating a view is as follows.
Create view name [(view Field List)] as select statement
Example:
Create view t (id, name, age, sex) asselect id, name, age, sex from teacher;
· View structure (view information, similar to view table information)
Desc t;
2. delete a view
If a view is no longer used, you can use the drop view statement to delete the view. The syntax format is as follows.
Drop view name
3. View Functions
· Make operations simple
· Avoid data redundancy
· Enhanced data security
· Improve the logical independence of data
The above is the Mysql view introduced by the small editor. I hope it will be helpful to you. If you have any questions, please leave a message. The small editor will reply to you in time. Thank you very much for your support for the help House website!