SlideShare a Scribd company logo
1 of 80
数学 与计算机科学学院软件工程系 数据库系统概论 An Introduction to Database System 第三章 关系数据库标准语言 SQL  ( 续 2 )
第三章  关系数据库标准语言 SQL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3.4  数 据 更 新  ,[object Object],[object Object],[object Object]
3.4.1  插入数据 ,[object Object],[object Object],[object Object]
1.  插入单个元组 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
插入单个元组(续) ,[object Object],[object Object],[object Object],[object Object],[object Object]
插入单个元组(续) ,[object Object],[object Object],[object Object],[object Object],[object Object]
插入单个元组(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
2.  插入子查询结果 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
插入子查询结果(续) ,[object Object],[object Object],[object Object],[object Object],[object Object]
插入子查询结果(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
插入子查询结果(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
插入子查询结果(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3.4  数 据 更 新  ,[object Object],[object Object],[object Object]
3.4.2  修改数据 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
修改数据(续) ,[object Object],[object Object],[object Object],[object Object]
1.  修改某一个元组的值 ,[object Object],[object Object],[object Object],[object Object]
2.  修改多个元组的值 ,[object Object],[object Object],[object Object]
修改多个元组的值 ( 续 ) ,[object Object],[object Object],[object Object],[object Object]
3.  带子查询的修改语句 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
修改数据(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
修改数据(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3.4  数 据 更 新  ,[object Object],[object Object],[object Object]
3.4.3  删除数据 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
删除数据(续) ,[object Object],[object Object],[object Object],[object Object]
1.  删除某一个元组的值 ,[object Object],[object Object],[object Object],[object Object]
2.  删除多个元组的值 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3.  带子查询的删除语句 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
删除数据 ( 续 ) ,[object Object],[object Object],[object Object],[object Object],[object Object]
更新数据与数据一致性 ,[object Object],[object Object],[object Object],[object Object]
第三章  关系数据库标准语言 SQL ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3.5  视  图 ,[object Object],[object Object],[object Object],[object Object]
3.5  视  图 ,[object Object],[object Object],[object Object],[object Object],[object Object]
3.5  视  图 ,[object Object],[object Object],[object Object],[object Object]
1.  建立视图 ,[object Object],[object Object],[object Object],[object Object],[object Object]
建立视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object]
组成视图的属性列名 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
行列子集视图 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
建立视图(续) ,[object Object],[object Object],[object Object],[object Object]
WITH CHECK OPTION 的视图 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
对 IS_Student 视图的更新操作 ,[object Object],[object Object],[object Object],[object Object],[object Object]
基于多个基表的视图 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
基于视图的视图 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
带表达式的视图 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
建立分组视图 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
建立视图(续) ,[object Object],[object Object]
建立视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
建立视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
常见的视图形式 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
2.  删除视图 ,[object Object],[object Object],[object Object],[object Object]
删除视图 ( 续) ,[object Object],[object Object]
3.5  视  图 ,[object Object],[object Object],[object Object],[object Object]
3.5.2  查询视图 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],new
查询视图(续) ,[object Object],[object Object],[object Object],[object Object]
查询视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
查询视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
查询视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object]
查询视图(续) ,[object Object],[object Object]
查询视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
查询转换 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3.5  视  图 ,[object Object],[object Object],[object Object],[object Object]
3.5.3  更新视图 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
更新视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
更新视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
更新视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
更新视图的限制 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
更新视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
视图的可更新性 ,[object Object],[object Object],[object Object]
实际系统对视图更新的限制 ,[object Object],[object Object],[object Object],[object Object],[object Object]
更新视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object]
更新视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3.5  视  图 ,[object Object],[object Object],[object Object],[object Object]
1.  视图能够 简化 用户的操作 ,[object Object],[object Object],[object Object],[object Object],[object Object]
2.  视图使用户能以 多种角度 看待同一数据 ,[object Object]
3. 视图对重构数据库提供了一定程度的逻辑独立性 ,[object Object],[object Object],[object Object],[object Object],[object Object]
3. 视图对重构数据库提供了一定程度的逻辑独立性 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
3.  视图对重构数据库提供了一定程度的 逻辑独立性 ,[object Object],[object Object],[object Object],[object Object]
4.  视图能够对机密数据提供安全保护 ,[object Object],[object Object]
建立视图(续) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],new
下课了。。。 休息一会儿。。。 追 求

More Related Content

Viewers also liked

Police Air Wing
Police Air Wing Police Air Wing
Police Air Wing mworboys
 
Guida alla scelta del corso di recupero
Guida alla scelta del corso di recuperoGuida alla scelta del corso di recupero
Guida alla scelta del corso di recuperoilcollega
 
Victorian PoliceAir Wing - Maxi Sarah and Nat
Victorian PoliceAir Wing - Maxi Sarah and NatVictorian PoliceAir Wing - Maxi Sarah and Nat
Victorian PoliceAir Wing - Maxi Sarah and Natmworboys
 
Web Flags - Digital Methods Summer 12
Web Flags - Digital Methods Summer 12Web Flags - Digital Methods Summer 12
Web Flags - Digital Methods Summer 12Sabine Niederer
 
Amituojing final
Amituojing finalAmituojing final
Amituojing finalJoe Chien
 
Presentation-Arus (Rough Draft of Storytelling for Games Project)
Presentation-Arus (Rough Draft of Storytelling for Games Project)Presentation-Arus (Rough Draft of Storytelling for Games Project)
Presentation-Arus (Rough Draft of Storytelling for Games Project)Jamie Vann
 
Link building, IT Open, Kragujevac 2014
Link building, IT Open, Kragujevac 2014Link building, IT Open, Kragujevac 2014
Link building, IT Open, Kragujevac 2014Nenad Pantelić
 
PPC u e-trgovini, PPC Radionica, etrgovina 2014
PPC u e-trgovini, PPC Radionica, etrgovina 2014PPC u e-trgovini, PPC Radionica, etrgovina 2014
PPC u e-trgovini, PPC Radionica, etrgovina 2014Nenad Pantelić
 
Presentacion club el rincón
Presentacion club el rincónPresentacion club el rincón
Presentacion club el rincónVanessa Alvarez
 
Evaluation of BlueJeans Command Center by Wainhouse Research
Evaluation of BlueJeans Command Center by Wainhouse ResearchEvaluation of BlueJeans Command Center by Wainhouse Research
Evaluation of BlueJeans Command Center by Wainhouse ResearchBlueJeans Network
 
Evaluation of BlueJeans Network by Wainhouse Research
Evaluation of BlueJeans Network by Wainhouse ResearchEvaluation of BlueJeans Network by Wainhouse Research
Evaluation of BlueJeans Network by Wainhouse ResearchBlueJeans Network
 
SEO u e-trgovini, SEO Radionica, etrgovina 2014
SEO u e-trgovini, SEO Radionica, etrgovina 2014SEO u e-trgovini, SEO Radionica, etrgovina 2014
SEO u e-trgovini, SEO Radionica, etrgovina 2014Nenad Pantelić
 
Battlefield 2 "Stealth Pack" Proposed Expansion Pack Presentation
Battlefield 2 "Stealth Pack" Proposed Expansion Pack PresentationBattlefield 2 "Stealth Pack" Proposed Expansion Pack Presentation
Battlefield 2 "Stealth Pack" Proposed Expansion Pack PresentationJamie Vann
 
The Benefits of Face-to-Face Communication
The Benefits of Face-to-Face CommunicationThe Benefits of Face-to-Face Communication
The Benefits of Face-to-Face CommunicationBlueJeans Network
 
The brain and memory, how long is it
The brain and memory, how long is itThe brain and memory, how long is it
The brain and memory, how long is itKelly Randall
 

Viewers also liked (16)

Police Air Wing
Police Air Wing Police Air Wing
Police Air Wing
 
Guida alla scelta del corso di recupero
Guida alla scelta del corso di recuperoGuida alla scelta del corso di recupero
Guida alla scelta del corso di recupero
 
Victorian PoliceAir Wing - Maxi Sarah and Nat
Victorian PoliceAir Wing - Maxi Sarah and NatVictorian PoliceAir Wing - Maxi Sarah and Nat
Victorian PoliceAir Wing - Maxi Sarah and Nat
 
зош №3. през.2011
зош №3. през.2011зош №3. през.2011
зош №3. през.2011
 
Web Flags - Digital Methods Summer 12
Web Flags - Digital Methods Summer 12Web Flags - Digital Methods Summer 12
Web Flags - Digital Methods Summer 12
 
Amituojing final
Amituojing finalAmituojing final
Amituojing final
 
Presentation-Arus (Rough Draft of Storytelling for Games Project)
Presentation-Arus (Rough Draft of Storytelling for Games Project)Presentation-Arus (Rough Draft of Storytelling for Games Project)
Presentation-Arus (Rough Draft of Storytelling for Games Project)
 
Link building, IT Open, Kragujevac 2014
Link building, IT Open, Kragujevac 2014Link building, IT Open, Kragujevac 2014
Link building, IT Open, Kragujevac 2014
 
PPC u e-trgovini, PPC Radionica, etrgovina 2014
PPC u e-trgovini, PPC Radionica, etrgovina 2014PPC u e-trgovini, PPC Radionica, etrgovina 2014
PPC u e-trgovini, PPC Radionica, etrgovina 2014
 
Presentacion club el rincón
Presentacion club el rincónPresentacion club el rincón
Presentacion club el rincón
 
Evaluation of BlueJeans Command Center by Wainhouse Research
Evaluation of BlueJeans Command Center by Wainhouse ResearchEvaluation of BlueJeans Command Center by Wainhouse Research
Evaluation of BlueJeans Command Center by Wainhouse Research
 
Evaluation of BlueJeans Network by Wainhouse Research
Evaluation of BlueJeans Network by Wainhouse ResearchEvaluation of BlueJeans Network by Wainhouse Research
Evaluation of BlueJeans Network by Wainhouse Research
 
SEO u e-trgovini, SEO Radionica, etrgovina 2014
SEO u e-trgovini, SEO Radionica, etrgovina 2014SEO u e-trgovini, SEO Radionica, etrgovina 2014
SEO u e-trgovini, SEO Radionica, etrgovina 2014
 
Battlefield 2 "Stealth Pack" Proposed Expansion Pack Presentation
Battlefield 2 "Stealth Pack" Proposed Expansion Pack PresentationBattlefield 2 "Stealth Pack" Proposed Expansion Pack Presentation
Battlefield 2 "Stealth Pack" Proposed Expansion Pack Presentation
 
The Benefits of Face-to-Face Communication
The Benefits of Face-to-Face CommunicationThe Benefits of Face-to-Face Communication
The Benefits of Face-to-Face Communication
 
The brain and memory, how long is it
The brain and memory, how long is itThe brain and memory, how long is it
The brain and memory, how long is it
 

Similar to 数据库原理第三章

第三章 关系数据库标准语言SQL.ppt this is a slide for databases
第三章 关系数据库标准语言SQL.ppt this is a slide for databases第三章 关系数据库标准语言SQL.ppt this is a slide for databases
第三章 关系数据库标准语言SQL.ppt this is a slide for databasesfzgaolanlan1
 
Oracle公司内部数据库培训资料
Oracle公司内部数据库培训资料Oracle公司内部数据库培训资料
Oracle公司内部数据库培训资料yiditushe
 
Spring入门纲要
Spring入门纲要Spring入门纲要
Spring入门纲要yiditushe
 
JdonFramework中文
JdonFramework中文JdonFramework中文
JdonFramework中文banq jdon
 
MySQL数据库生产环境维护
MySQL数据库生产环境维护MySQL数据库生产环境维护
MySQL数据库生产环境维护mysqlops
 
Kid171 chap03 traditional Chinese Version
Kid171 chap03 traditional Chinese VersionKid171 chap03 traditional Chinese Version
Kid171 chap03 traditional Chinese VersionFrank S.C. Tseng
 
Sql Server 高级技巧系列之三整体优化
Sql Server 高级技巧系列之三整体优化Sql Server 高级技巧系列之三整体优化
Sql Server 高级技巧系列之三整体优化向 翔
 
Something about oracle joins
Something about oracle joinsSomething about oracle joins
Something about oracle joinsmysqlops
 
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作byron zhao
 
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作byron zhao
 
Row Set初步学习V1.1
Row Set初步学习V1.1Row Set初步学习V1.1
Row Set初步学习V1.1Zianed Hou
 
Oracle数据库体系结构简介.ppt
Oracle数据库体系结构简介.pptOracle数据库体系结构简介.ppt
Oracle数据库体系结构简介.pptjames tong
 
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit TestingASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing江華 奚
 
NeteaseBlog Objective-C Style Guide
NeteaseBlog Objective-C Style GuideNeteaseBlog Objective-C Style Guide
NeteaseBlog Objective-C Style Guidejenkinv
 
第9章 transact sql程序设计
第9章   transact sql程序设计第9章   transact sql程序设计
第9章 transact sql程序设计hanmo1988
 
组件交互模式的非主流研究
组件交互模式的非主流研究组件交互模式的非主流研究
组件交互模式的非主流研究youalab
 
Struts快速学习指南
Struts快速学习指南Struts快速学习指南
Struts快速学习指南yiditushe
 
腾讯大讲堂48 数据库查询优化浅析
腾讯大讲堂48 数据库查询优化浅析腾讯大讲堂48 数据库查询优化浅析
腾讯大讲堂48 数据库查询优化浅析George Ang
 

Similar to 数据库原理第三章 (20)

第三章 关系数据库标准语言SQL.ppt this is a slide for databases
第三章 关系数据库标准语言SQL.ppt this is a slide for databases第三章 关系数据库标准语言SQL.ppt this is a slide for databases
第三章 关系数据库标准语言SQL.ppt this is a slide for databases
 
Oracle公司内部数据库培训资料
Oracle公司内部数据库培训资料Oracle公司内部数据库培训资料
Oracle公司内部数据库培训资料
 
9
99
9
 
Spring入门纲要
Spring入门纲要Spring入门纲要
Spring入门纲要
 
JdonFramework中文
JdonFramework中文JdonFramework中文
JdonFramework中文
 
MySQL数据库生产环境维护
MySQL数据库生产环境维护MySQL数据库生产环境维护
MySQL数据库生产环境维护
 
Kid171 chap03 traditional Chinese Version
Kid171 chap03 traditional Chinese VersionKid171 chap03 traditional Chinese Version
Kid171 chap03 traditional Chinese Version
 
7
77
7
 
Sql Server 高级技巧系列之三整体优化
Sql Server 高级技巧系列之三整体优化Sql Server 高级技巧系列之三整体优化
Sql Server 高级技巧系列之三整体优化
 
Something about oracle joins
Something about oracle joinsSomething about oracle joins
Something about oracle joins
 
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
 
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作实验报告4:使用SQL语句进行SQL Server 2000数据库操作
实验报告4:使用SQL语句进行SQL Server 2000数据库操作
 
Row Set初步学习V1.1
Row Set初步学习V1.1Row Set初步学习V1.1
Row Set初步学习V1.1
 
Oracle数据库体系结构简介.ppt
Oracle数据库体系结构简介.pptOracle数据库体系结构简介.ppt
Oracle数据库体系结构简介.ppt
 
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit TestingASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
ASP.NET Core MVC 2.2從開發到測試 - Development & Unit Testing
 
NeteaseBlog Objective-C Style Guide
NeteaseBlog Objective-C Style GuideNeteaseBlog Objective-C Style Guide
NeteaseBlog Objective-C Style Guide
 
第9章 transact sql程序设计
第9章   transact sql程序设计第9章   transact sql程序设计
第9章 transact sql程序设计
 
组件交互模式的非主流研究
组件交互模式的非主流研究组件交互模式的非主流研究
组件交互模式的非主流研究
 
Struts快速学习指南
Struts快速学习指南Struts快速学习指南
Struts快速学习指南
 
腾讯大讲堂48 数据库查询优化浅析
腾讯大讲堂48 数据库查询优化浅析腾讯大讲堂48 数据库查询优化浅析
腾讯大讲堂48 数据库查询优化浅析
 

数据库原理第三章