当前位置:网站首页>Database objects: view learning records
Database objects: view learning records
2022-07-01 06:35:00 【Small dollar】
Common database objects
surface
The data dictionary : Just check without modifying
constraint :
View :
Indexes :
stored procedure :
Storage function :
trigger :
View
Views are built on existing tables , Existing tables are called base tables
The advantages of views simplify queries
Views are generally used on large projects , Can control data and access .
Create a view , For single table
CREATE VIEW vu_emp1
AS
SELECT employee_id,last_name,salary
FROM emps
Based on multiple tables
Use the view to format the data
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
Create views based on views
View view
There are four ways to view
View view show tables
View view structure describe xx
View the attribute information of the view :SHOW TABLE STATUS LIKE ‘abc’
View the detailed definition information of the view
Changes to the view will affect the data in the table
Generally, the update of view will affect the data , There are also situations that will not be updated
Modify the view , Delete view
CREATE OR REPLACE VIEW vu_emp1
AS
SELECT email,last_name,employee_id FROM emps
Modify the view
DROP VIEW vu_empl
边栏推荐
- Code power is full of quantitative learning | how to find a suitable financial announcement in the financial report
- 自开发软件NoiseCreater1.1版本免费试用
- C#如何打印输出原版数组
- B-tree series
- C language course set up student elective course system (big homework)
- C语言课设学生选修课程系统(大作业)
- [ITSM] what is ITSM and why does it department need ITSM
- VS2019如何永久配置本地OpenCV4.5.5使用
- SQL statement
- sci-hub如何使用
猜你喜欢
随机推荐
C language course is provided with employee information management system (large operation)
Teach you how to implement a deep learning framework
问题解决:OfficeException: failed to start and connect(一)
sci-hub如何使用
SQL学习笔记2
webapck打包原理--启动过程分析
SQL学习笔记九种连接2
Lxml module (data extraction)
C#如何打印輸出原版數組
TCL statements in SQL (transaction control statements)
Postgraduate entrance examination directory link
[ManageEngine Zhuohao] helps Huangshi Aikang hospital realize intelligent batch network equipment configuration management
C语言课设职工信息管理系统(大作业)
Code power is full of quantitative learning | how to find a suitable financial announcement in the financial report
ESP32 ESP-IDF GPIO按键中断响应
C language course set up library information management system (big homework)
【微信小程序】如何搭积木式开发?
【#Unity Shader#自定义材质面板_第一篇】
lxml模块(数据提取)
脏读、幻读和不可重复读








