当前位置:网站首页>数据库对象:视图学习记录
数据库对象:视图学习记录
2022-07-01 06:21:00 【小美元】
常见的数据库对象
表
数据字典:只是查看不用修改
约束:
视图:
索引:
存储过程:
存储函数:
触发器:
视图
视图建立在已有的表上,已有的表称作基表
视图的优点简化查询
视图一般用在大型项目上边,可以控制数据和访问。
建立一个视图,针对单表的情况
CREATE VIEW vu_emp1
AS
SELECT employee_id,last_name,salary
FROM emps
基于多表
利用视图对数据进行格式化
CREATE VIEW abc AS
SELECT CONCAT(last_name,‘(’,department_name,‘)’) FROM emps e JOIN depts d ON e.department_id = d.department_id
SELECT * FROM abc
基于视图去创建视图
查看视图
四种方式查看
查看视图 show tables
查看视图结构 describe xx
查看视图的属性信息:SHOW TABLE STATUS LIKE ‘abc’
查看视图的详细定义信息
对视图的修改会影响到表中的数据
视图的更新一般情况下会影响到数据,也有情况不会更新
修改视图,删除视图
CREATE OR REPLACE VIEW vu_emp1
AS
SELECT email,last_name,employee_id FROM emps
修改视图
DROP VIEW vu_empl
边栏推荐
- 10-golang运算符
- FPGA - clocking -02- clock wiring resources of internal structure of 7 Series FPGA
- Forkjoin and stream flow test
- ABP 学习解决方案中的项目以及依赖关系
- Pol8901 LVDS to Mipi DSI supports rotating image processing chip
- [ManageEngine Zhuohao] the role of LAN monitoring
- SQL语句
- Flink practice -- multi stream merge
- 伪装请求头库: anti-useragent
- [summary of knowledge points] chi square distribution, t distribution, F distribution
猜你喜欢

MongoDB:一、MongoDB是什么?MongoDB的优缺点

连续四年入选Gartner魔力象限,ManageEngine卓豪是如何做到的?
![阿里OSS Postman Invalid according to Policy: Policy Condition failed: [“starts-with“, “$key“, “test/“]](/img/3c/7684b7c594f7871471f89007294703.png)
阿里OSS Postman Invalid according to Policy: Policy Condition failed: [“starts-with“, “$key“, “test/“]

【#Unity Shader#Amplify Shader Editor(ASE)_第九篇】

Redis安装到Windows系统上的详细步骤

Student attendance system for C language course (big homework)
![[unity shader custom material panel part II]](/img/d1/8632ae680299a27b7431b2d6e03fd3.png)
[unity shader custom material panel part II]

Discrimination between left and right limits of derivatives and left and right derivatives

高阶-二叉平衡树

Tidb database characteristics summary
随机推荐
10-golang运算符
Mongodb: I. what is mongodb? Advantages and disadvantages of mongodb
【LeetCode】Day91-存在重复元素
阿里OSS Postman Invalid according to Policy: Policy Condition failed: [“starts-with“, “$key“, “test/“]
Treasure taking from underground palace (memory based deep search)
B-树系列
HCM Beginner (II) - information type
High order binary balanced tree
How did ManageEngine Zhuohao achieve the goal of being selected into Gartner Magic Quadrant for four consecutive years?
C language course set up property fee management system (big work)
[ManageEngine] how to realize network automatic operation and maintenance
记磁盘扇区损坏导致的Mysql故障排查
H5网页判断是否安装了某个APP,安装则跳转未安装则下载的方案总结
Comment imprimer le tableau original
网络爬虫
阶乘约数(唯一分解定理)
sci-hub如何使用
地宫取宝(记忆化深搜)
ABP 学习解决方案中的项目以及依赖关系
json模块