当前位置:网站首页>数据库对象:视图学习记录
数据库对象:视图学习记录
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
边栏推荐
- Understanding of C manualresetevent class
- 伪装请求头库: anti-useragent
- Redis安装到Windows系统上的详细步骤
- 手把手教你实现一个深度学习框架...
- [unity shader amplify shader editor (ASE) Chapter 9]
- HDU - 1501 Zipper(记忆化深搜)
- SystemVerilog learning-07-class inheritance and package use
- Three minutes to quickly understand the whole process of website development
- 【Unity Shader 描边效果_案例分享第一篇】
- idea 好用插件汇总!!!
猜你喜欢

Movable mechanical wall clock

【ITSM】什么是ITSM,IT部门为什么需要ITSM

记磁盘扇区损坏导致的Mysql故障排查

C语言课设图书信息管理系统(大作业)

Application of IT service management (ITSM) in Higher Education

C language course set up student elective course system (big homework)

图片服务器项目测试

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

连续四年入选Gartner魔力象限,ManageEngine卓豪是如何做到的?

Design of sales management system for C language course (big homework)
随机推荐
端口扫描工具对企业有什么帮助?
C语言课设工资管理系统(大作业)
交换机配置软件具有的作用
How does the port scanning tool help enterprises?
C语言课设销售管理系统设计(大作业)
How did ManageEngine Zhuohao achieve the goal of being selected into Gartner Magic Quadrant for four consecutive years?
端口扫描工具是什么?端口扫描工具有什么用
【ManageEngine】如何实现网络自动化运维
C语言课设学生选修课程系统(大作业)
Code power is full of quantitative learning | how to find a suitable financial announcement in the financial report
JMM详解
Flink practice -- multi stream merge
[automatic operation and maintenance] what is the use of the automatic operation and maintenance platform
微信公众号内嵌跳转微信小程序方案总结
H5网页判断是否安装了某个APP,安装则跳转未安装则下载的方案总结
JDBC connection pool
【#Unity Shader#Amplify Shader Editor(ASE)_第九篇】
C language course is provided with employee information management system (large operation)
扩散(多源广搜)
sci-hub如何使用