view: Views in MySQL have many similarities with tables. Views are also composed of several fields and several records. Views can also be used as data sources for select statements. What is saved in the view is just a select statement, which saves the view definition but not the actual data. The source data in the view all 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 for creating a view is as follows. create view view name [(view field list)] as select statement example: create view t (id,name,age,sex) as select id,name,age,sex from teacher; View the view structure (view the view information, similar to viewing the table information) desc t; 2. Delete the 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 view name 3. The role of view · Make operations simple · Avoid data redundancy · Enhance data security · Improve the logical independence of data The above is the introduction of views in Mysql by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Ajax jquery realizes the refresh effect of a div on the page
>>: Several common ways to deploy Tomcat projects [tested]
Download source code git clone https://github.com...
Table of contents posgresql backup/restore mysql ...
Table of contents Preface difficulty Cross-domain...
Preface: For the implementation of digital additi...
Preface When I was writing a small project yester...
This article example shares the specific code of ...
The computer system has been reinstalled, and the...
MySQL multi-table query Add a worksheet -- User t...
It is very common to use webpack to build single-...
1. View the current host name [root@fangjian ~]# ...
JBoss uses Tomcat as the Web container, so the co...
1. Dynamic query rules The dynamic query rules ar...
CSS3Please Take a look at this website yourself, ...
It is not easy to adjust the vertical center align...
question After Nginx reverse proxy, the Tomcat ap...