当前位置:网站首页>MySQL视图
MySQL视图
2022-07-23 05:41:00 【夏日入侵bug企划】
MySQL视图(view)
视图:同一张表的数据,通过不同角度看待;
只有DQL数据查询语言才能创建视图
创建视图
create view myview视图名 as DQL语句;
删除视图
drop view myview视图名;
对视图进行增删改查,会影响到原表数据
通过视图影响原表数据的,不是直接操作的原表
例子:
create table emp_bak as select * from emp;
create view 视图名 as select empno,ename,sal from emp_bak;
update 视图名 set ename='hehe',sal=1 where empno = 7369; // 通过视图修改原表数据。
delete from 视图名 where empno = 7369; // 通过视图删除原表数据。
视图的作用
视图可以隐藏表的实现细节。保密级别较高的系统,数据库只对外提供相关的视图,程序员只对视图对象进行CRUD。
边栏推荐
- MySQL sorts by Chinese field initials
- Genesis曾向三箭资本提供23.6亿美元的贷款
- 数仓4.0笔记——用户行为数据采集一
- [pyautogui learning] screen coordinates and mouse scrolling
- NFT数字藏品系统开发,数字藏品的发展趋势
- Wordcount of the first Flink program
- 数字藏品系统开发:NFT的主要特点有哪些?
- Scala之二流程控制
- User defined MVC usage & addition, deletion, modification and query
- [untitled]
猜你喜欢

Image fuzzy processing batch production fuzzy data set

蚂蚁链NFT数字藏品DAPP商城系统定制开发

The 6th "Blue Hat Cup" National College Students' Cyber Security Skills Competition - preliminary writeup

Activiti7 Quick Start experience sharing
![[flick]flick on yarn's flick conf simplest configuration](/img/de/0ec23f3379148dba27fe77dc51e22f.png)
[flick]flick on yarn's flick conf simplest configuration

数仓4.0笔记——业务数据采集

phxpaxos安装编译流程

Installation and process creation of activiti app used by activiti workflow

NFT交易平台数字藏品系统|开发定制

Machine learning algorithm for large factory interview (5) recommendation system algorithm
随机推荐
美联储理事沃勒:去中心化金融最终可能会改变传统金融市场
[flick]flick on yarn's flick conf simplest configuration
Review of knowledge points
Kubesphere ha install (II)
规范数据库设计
Typescript common types
Federal Reserve governor Waller: decentralized finance may eventually change the traditional financial market
window下vmware使用无线网卡nat的方式上网
Data warehouse 4.0 notes - user behavior data collection IV
MySQL account management & four engines & database and table building
sql-labs 5-6通关笔记
Method of recognizing b value from DICOM tag in DWI image
NFT digital collection system development: the combination of music and NFT
sql实现连续登陆7天以上用户统计
[untitled]
Usage of some, every, find, FindIndex
Understanding of the decoder in the transformer in NLP
NFT数字藏品系统开发,数字藏品的发展趋势
NepCTF2022 Writeup
Digital collection development / digital collection system development solution