Detailed description of the Mysql view, detailed description of the Mysql View

Source: Internet
Author: User
Tags mysql view

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.