当前位置:网站首页>Database view detailed exploration
Database view detailed exploration
2022-07-23 13:41:00 【kokotao】
One 、 Define views :
1 View creation :SQL Used in language CREATE VIEW Command to establish ;
Example :
Create view <name> [< Name >[,< Name >]···)]
as < Subquery > with check option];
The subquery can be any select sentence
In relational database management system create view The result of the statement is to save the definition of the view into the data , They don't execute select sentence .
Two 、 Row column subset view
Derived from a single basic table , And just remove some rows and columns of the basic table , But the main code is retained , Then this kind of view is called row and column view .
create view IS_Student
as
selcet Sno,Sname,Sage
from student
where Sdept='IS';
IS_Student The view can be regarded as a row column subset view ;
Views can not only be built on a single basic table , It can also be built on multiple basic tables ;
Views can not only be built on multiple basic tables , It can also be built on one or more defined views , Or based on basic tables and views .
3、 ... and 、 Delete view
sentence :
drop view < View name >[cascade];
Four 、 Query view
Example : In the view of information department students, find out that they are younger than 20 Year old student .
select Sno,Sage
from IS_Student
where Sage<20;
5、 ... and Update the view
Update view is generally used insert( Insert )、delete( Delete )、update( modify ) data ;
Example :
View computer students IS_Student The middle school number is 2011050321 The student's name is changed to “ Zhang Yu ”.
update IS_Student
set Sname=' Zhang Yu '
where Sno='2011050321';
The update statement after actual conversion is :
update Student
set Sname=' Zhang Yu '
where Sno='2011050321' and Sdept='IS';
6、 ... and The function of view ( advantage )
1 View can simplify the operation of users ;
2 Views enable users to view the same data from multiple perspectives ;
3 Views provide a certain degree of logical independence for refactoring the database ;
4 View can provide security for confidential data ;
5 Using views properly can express queries more clearly ;
边栏推荐
- ROS2自学笔记:URDF机器人建模
- Target segmentation for 10000 frames of video, with less than 1.4GB of video memory | eccv2022
- Jupyter notebook add existing virtual environment
- Successful joint commissioning of Vientiane Aoke and CoDeSys Technology
- kubernetes 的这几种存储卷,别再傻傻分不清了
- [daily training] 814. Binary tree pruning
- Day 12 notes
- Debug No5 basic lighting
- Introduction to radar part vii 3 formation and processing of SAR image
- [jzof] 09 realize queue with two stacks
猜你喜欢

Kept dual machine hot standby

云解决方案,为什么选择 AMD EPYC?
![[jzof] 07 rebuild binary tree](/img/c8/5b67a3921afda5323b0d1eea6a78bc.png)
[jzof] 07 rebuild binary tree

Point target simulation of SAR imaging (III) -- Analysis of simulation results

China leads the United States in another emerging technology field and stands at the commanding height of scientific and technological innovation

Remote editing and debugging with vscode

Beifu and C transmit real type through ads communication

"Computing beast" Inspur nf5468a5 GPU server open trial free application

vs2019:constexpr 函数“qCountLeadingZeroBits”不能生成常量表达式

keepalived双机热备
随机推荐
PHP gets the current timestamp three bit MS MS timestamp
General contents of radar introduction column
Day 10 notes
Google Play应用商店可能会删除应用权限概述 转而使用新的数据安全信息组合
中国在又一个新兴科技领域领先美国,站在科技创新制高点
[图形学]ASTC纹理压缩格式
Beifu PLC -- C ads communication reads variables in the form of notification
Matplotlib- implement common probability distributions
Feynman learning method (redis summary)
4D antenna array layout design
Running matlab program on GPU
About this pointer
Target segmentation for 10000 frames of video, with less than 1.4GB of video memory | eccv2022
Metaapp development interview questions
-XX:+UseCGroupMemoryLimitForHeap 无法创建虚拟机问题
Smart canteen data analysis system
Hardware system architecture of 4D millimeter wave radar
Compilation and preprocessing
Client does not support authentication protocol requested by server; consider upgrading MySQL client
Deep understanding of the underlying framework of wechat applet (I)