Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of creating views by using SQL statements in navicat

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the method of navicat using SQL statements to create views, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Navicat is a very easy to use database management software, its function is very powerful. Use the SQL statement in navicat to create a view

First we need to open navicat. Select the database you want to operate on. Click query to create a new query. Use the create view statement to create a view.

Create view View_name as select * from table_name where Mid > 1

Then click run to create the view.

Extended data: the role of views

The first point: using views, you can customize user data and focus on specific data.

Explanation:

In the actual process, the company has different roles of staff, we take the sales company as an example, procurement personnel, can need some data related to him, and data that has nothing to do with him, does not make any sense to him, we can according to this actual situation, specifically for the procurement staff to create a view, later when he queries the data, just need select * from view_caigou.

The second point: using views, you can simplify data manipulation.

Explanation:

When we use queries, we often use aggregate functions, display information about other fields, and may need to be associated with other tables. The statement written may be very long. If this action occurs frequently, we can create views. After that, all we need is select * from view1, isn't it very convenient?

The third point: using the view, the data in the base table has a certain degree of security.

Explanation:

Because the view is virtual and does not exist physically, but only stores the collection of data, we can give the important field information in the base table to the user without going through the view, which is a collection of dynamic data. the data is updated with the update of the base table. At the same time, the user can not change and delete the view at will, which can ensure the security of the data.

Fourth point: you can merge separate data to create partitioned views (/ / I don't use it at the moment)

Explanation:

With the development of society and the continuous expansion of the company's business, a large company and its subordinates have many branches. In order to facilitate management, we need to unify the structure of the table and check the business situation of each company on a regular basis. It is very inconvenient to look at the data of each company separately, and there is no good comparability. If these data are merged into one table, it will be much more convenient. At this point, we can use the union keyword to merge the data of each branch into a single view.

Thank you for reading this article carefully. I hope the article "navicat uses SQL sentences to create views" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report