当前位置:网站首页>数据库对象:视图学习记录
数据库对象:视图学习记录
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
边栏推荐
- C语言课设学生选修课程系统(大作业)
- Elements of database ER diagram
- 做技术,自信不可或缺
- [unity shader amplify shader editor (ASE) Chapter 9]
- 10-golang运算符
- Dongle data collection
- What is a port scanning tool? What is the use of port scanning tools
- Top 10 Free 3D modeling software for beginners in 2022
- Functions of switch configuration software
- FPGA - 7 Series FPGA internal structure clocking-01-clock Architecture Overview
猜你喜欢

SQL语句

图片服务器项目测试

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

ManageEngine卓豪助您符合ISO 20000标准(四)

Excel visualization

Forkjoin and stream flow test
![[ManageEngine] how to realize network automatic operation and maintenance](/img/8a/75332d3180f92c6a6482d881032bbf.png)
[ManageEngine] how to realize network automatic operation and maintenance

JDBC database operation

async 与 await

Redis安装到Windows系统上的详细步骤
随机推荐
Pol8901 LVDS to Mipi DSI supports rotating image processing chip
【ManageEngine】如何实现网络自动化运维
HDU - 1501 Zipper(记忆化深搜)
C语言课设学生考勤系统(大作业)
1034 Head of a Gang
端口扫描工具是什么?端口扫描工具有什么用
图片服务器项目测试
B-tree series
JDBC database operation
[file system] how to run squashfs on UBI
Mongodb: I. what is mongodb? Advantages and disadvantages of mongodb
SystemVerilog learning-10-validation quantification and coverage
Design of sales management system for C language course (big homework)
lxml模块(数据提取)
扩散(多源广搜)
Tidb database characteristics summary
HCM Beginner (III) - quickly enter pa70 and pa71 to browse employee information PA10
Understanding of C manualresetevent class
[postgraduate entrance examination advanced mathematics Wu Zhongxiang +880 version for personal use] advanced mathematics Chapter II Basic Stage mind map
浅谈SIEM