




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、数据库系统,山东女子学院信息技术学院,第一讲,李 缨 TelQQ: 961134625 E-Mail: cherry_jn,课程教材及参考书目,主用教材: 数据库系统概念第5版,耶鲁大学等学校,西尔伯沙茨等著,杨冬青(北京大学)等译,机械工业出版社。 Database System ComceptsFifth Edtion, Silberschatz A.A.(英文) 本课程只介绍前三部分中的内容 第一部分(1-10章)第二部分(11-22章)第三部分(23-25章) 本教材所参考的网站主页(耶鲁大学) /avi/db-b
2、ook/ 参考书目: 1数据库原理王能斌,机械工业出版社,2001年1月,第1版 2数据系统原理教程王珊等,清华大学出版社, 1999年5月,第3次印刷 3关系数据库石树刚等,清华大学出版社,1993年11月,第1版 4数据库系统基础教程(中译本)机械工业出版社出版,2006.03, 第1版3次印刷A First Course in Database Systems(斯坦福大学),Jeffrey D. Ullman, Edition 2 China Machine Press,July 2006,First Version,First Print),教学目的、 要求,Lean knowledg
3、e about DB 考试: 平时出勤 10% 期中(作业) 20% 期末考试 70% 学习方法 : PowerPoint 每1-2分钟一页。信息量较大, 希望作笔记。试验表明,复制PPT,效果不好 不动笔墨不读书,铅笔在书上作笔记 内容较多,讲课速度不易掌握(尽量照顾中间),请同学们反馈, 插话提问 请课后复习整理,做好提前预习 Re-discover something(十分重要),Chapter 1: Introduction 概论,要点, 第一章 蜻蜓点水 Purpose of Database Systems 目的 View of Data 数据视图 Database Languag
4、es 数据库语言 Relational Databases 关系数据库 Database Design 数据库绍设计 Object-based and semistructured databases 面向对象数据库 Data Storage and Querying 数据存储和查询 Transaction Management 事务管理 Database Architecture 数据库体系结构 Database Users and Administrators 用户和管理员 Overall Structure 总体结构 History of Database Systems 数据库历史,1
5、.1 Database Management System (DBMS) Cp1,Collection of interrelated data 相关的数据集合 Set of programs to access the data 用一组程序存取 DBMS contains information about a particular enterprise 企业信息 DBMS provides an environment that is both convenient and efficient to use. 提供有效 方便的环境 Database Applications: 数据库应用
6、Banking: all transactions 银行 Airlines: reservations, schedules 机场,订票 ,计划 Universities: registration, grades 大学,注册,记分 Sales: customers, products, purchases 销售 Manufacturing: production, inventory, orders, supply chain制造 Human resources: employee records, salaries, 人事 工资 Databases touch all aspects of
7、 our lives 数据库渗透到各行各业,本讲义约定: 小字体或浅色字仅引悬念,将在下页解释,Database Management System (DBMS),Collection of interrelated data 相关的数据集合 Set of programs to access the data 用一组程序存取 DBMS contains information about a particular enterprise 企业信息 DBMS provides an environment that is both convenient and efficient to use.
8、 提供有效 方便的环境 Database Applications: 数据库应用 Banking: all transactions 银行 Airlines: reservations, schedules 机场,订票 ,计划 Universities: registration, grades 大学,注册,记分 Sales: customers, products, purchases 销售 Manufacturing: production, inventory, orders, supply chain制造 Human resources: employee records, salar
9、ies, 人事 工资 Databases touch all aspects of our lives 数据库渗透到各行各业,上页已讲,1.2 Purpose of Database System DB 目的 ep2,In the early days, database applications were built on top of file systems 70年代,数据库实质上是文件系统 Drawbacks of using file systems to store data: 文件系统的不足 Data redundancy and inconsistency 冗余 Multipl
10、e file formats, duplication of information in different files 格式多杂 Difficulty in accessing data 不易存取 Need to write a new program to carry out each new task Data isolation multiple files and formats 孤立 Integrity problems 完整性不好 Integrity constraints (e.g. account balance 0) become part of program code
11、 完整性约束 如余额不能为负 Hard to add new constraints or change existing ones,Purpose of Database Systems (Cont.),Drawbacks of using file systems (cont.) 文件系统的不足 (续) Atomicity of updates 更新异常 Failures may leave database in an inconsistent state with partial updates carried out 软硬件错误会导致数据不一致 E.g. transfer of fu
12、nds from one account to another should either complete or not happen at all 如中途停电 Concurrent access by multiple users 多用户并发 Concurrent accessed needed for performance 并发较快 Uncontrolled concurrent accesses can lead to inconsistencies 失控并发出错 E.g. two people reading a balance and updating it at the sam
13、e time Security problems 安全问题,Chapter 1: Introduction 概论,要点, 第一章 蜻蜓点水 Purpose of Database Systems 目的 View of Data 数据视图 Database Languages 数据库语言 Relational Databases 关系数据库 Database Design 数据库绍设计 Object-based and semistructured databases 面向对象数据库 Data Storage and Querying 数据存储和查询 Transaction Management
14、 事务管理 Database Architecture 数据库体系结构 Database Users and Administrators 用户和管理员 Overall Structure 总体结构 History of Database Systems 数据库历史,1.3 View of Data 视图 cp3,An architecture for a database system,瞎子摸到的大象,局部性质,百科全书中的大象,森林中的大象,V-L映射,逻辑独立性,L-P映射 物理独立性,2 View of Data 视图 cp4,An architecture for a databas
15、e system,百科全书中的大象,森林中的大象,V-L映射,逻辑独立性,L-P映射 物理独立性,瞎子摸到的大象,局部性质,2 View of Data 视图 cp4,An architecture for a database system,瞎子摸到的大象,百科全书中的大象,森林中的大象,V-L映射,逻辑独立性,L-P映射 物理独立性,Levels of Abstraction 抽象水平 ep4,Physical level describes how a record (e.g., customer) is stored. 物理层描述如何保存(磁介质等) 森林中的大象 Logical le
16、vel: describes data stored in database, and the relationships among the data. 逻辑水平描述数据之间的联系 type customer = record name : string; street : string; city : integer; end; 上面是PASCAL的类型,文件中等长记录, 百科全书中的大象 View level: application programs hide details of data types. Views can also hide information (e.g., s
17、alary) for security purposes. 视图水平:应用程序隐藏细节 ,可欺上瞒下, 瞎子摸到的大象,Levels of Abstraction 抽象水平 cp4,Physical level describes how a record (e.g., customer) is stored. 物理层描述如何保存(磁介质等) 森林中的大象 Logical level: describes data stored in database, and the relationships among the data. 逻辑水平描述数据之间的联系 type customer = re
18、cord name : string; street : string; city : integer; end; 上面是PASCAL的类型,文件中等长记录, 百科全书中的大象 View level: application programs hide details of data types. Views can also hide information (e.g., salary) for security purposes. 视图水平:应用程序隐藏细节 ,可欺上瞒下, 瞎子摸到的大象,Data Models 数据模型 ep7 ,A collection of tools for de
19、scribing 一个软工具集合,以描述 data 数据 data relationships 数据之间的联系 data semantics 数据语义 data constraints 数据约束 Entity-Relationship model 实体联系模型 Relational model 关系模型 Other models: object-oriented model 面向对象模型 semi-structured data models 半结构模型 Older models: network model and hierarchical model 其他模型,网状,层次模型,模型,模式
20、与 实例 cp 5,Model ,(模特),骨架 ,全局,数据联系 拓扑结构,学校,院,部,处,系,所,模特 (俗名) 模型(雅名) 实例 (服装) 模式 CS ( DName, Address,Phone),局部 结构,女院,CS,计科系,DB所,有补充,网状模型,层次模型,上页为层次模型(全局,树,一个结至多一个父结点 添红线,为网状,学校,院,部,处,系,所,模特 (俗名) 模型(雅名) 实例 (服装) 模式 CS ( DName, Address,Phone) 局部,女院,CS,计科系,DB所,Instances and Schemas 实例与模式,网状中允许一个结点有多个父结点 ,层
21、次是网状的特例。 网状模型 (DBTG) 层次模型(IMS) 10多年前开始下岗,现基本下岗完毕。所以性教材均不详细介绍,模型何许物也?是: 数据的骨架、 联系的抽象、 信息的依托、 交流思想的工具、 理解数据的提纲,Instances and Schemas 实例与模式,论文中常常见到: To Solve XXX Problem this paper proposes a new model named XXXXXX 模型=集合(符号)+运算 + 一组规律(结合,交换律) 模型是 含糊的概念,多义的词汇,被滥用的术语。 ,Instances and Schemas 实例与模式,Similar
22、 to types and variables in programming languages Schema the logical structure of the database 模式:逻辑结构 e.g., the database consists of information about a set of customers and accounts and the relationship between them) Physical schema: database design at the physical level,类比:语言中的变量 与 类型 , 个体 与 集体 ,
23、值 与 型,Instances and Schemas 实例与模式,Schema the logical structure of the database e.g., the database consists of information about a set of customers and accounts and the relationship between them) Analogous to type information of a variable in a program Physical schema: database design at the physical
24、 level Logical schema: database design at the logical level,模式:逻辑结构 ,DB 由 顾客记录组成,物理模式 : 物理水平的设计方式,逻辑模式 :逻辑水平的设计方式,Instances and Schemas 实例与模式,Schema the logical structure of the database e.g., the database consists of information about a set of customers and accounts and the relationship between the
25、m) Analogous to type information of a variable in a program Physical schema: database design at the physical level Logical schema: database design at the logical level,模式:逻辑结构 ,DB 由 顾客记录组成,物理模式 : 物理水平的设计方式,逻辑模式 :逻辑水平的设计方式,Instances and Schemas 实例与模式,Schema the logical structure of the database e.g.,
26、 the database consists of information about a set of customers and accounts and the relationship between them) Analogous to type information of a variable in a program Physical schema: database design at the physical level Logical schema: database design at the logical level,模式:逻辑结构 ,DB 由 顾客记录组成,物理模
27、式 : 物理水平的设计方式,逻辑模式 :逻辑水平的设计方式,Instances and Schemas 实例与模式 cp5,Instance the actual content of the database at a particular point in time Analogous to the value of a variable 实例 :按模式组织的一个具体的数据,Instances and Schemas 实例与模式cp5 ,Physical Data Independence the ability to modify the physical schema without
28、changing the logical schema 物理独立性 Applications depend on the logical schema In general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others.,应用依赖与逻辑模式,两层独立性的目的: 下面变化了,上层可以不变或少变,Chapter 1: Introduction 概论,要点,
29、第一章 蜻蜓点水 Purpose of Database Systems 目的 View of Data 数据视图 Database Languages 数据库语言 Relational Databases 关系数据库 Database Design 数据库绍设计 Object-based and semistructured databases 面向对象数据库 Data Storage and Querying 数据存储和查询 Transaction Management 事务管理 Database Architecture 数据库体系结构 Database Users and Admini
30、strators 用户和管理员 Overall Structure 总体结构 History of Database Systems 数据库历史,1.4 Data Definition Language (DDL) 数据定义语言 cp6,E.g.建表 create table account ( account-number char(10), balance integer) DDL compiler generates a set of tables stored in a data dictionary Data dictionary contains metadata 元数据 data
31、base schema Data storage and definition language language in which the storage structure and access methods used by the database system are specified Usually an extension of the data definition language,DDL例子,存储结构存取方法,模式,字段长度 名称类型,Data Definition Language (DDL) 数据定义语言 cp6,Integrity constraints 完整性约束
32、 Domain constraints Referential integrity (references constraint in SQL) Assertions Authorization 授权,Data Manipulation Language (DML) 数据操纵语言 cp6,查 插 删 改 Language for accessing and manipulating the data organized by the appropriate data model DML also known as query language Two classes of languages
33、两类语言 Procedural user specifies what data is required and how to get those data 过程式,怎么作 Nonprocedural user specifies what data is required without specifying how to get those data 要什么 SQL is the most widely used query language 最常用语言,数据操纵语言 查询语言,Data Manipulation Language (DML) 数据操纵语言 cp6,查 插 删 改 Lang
34、uage for accessing and manipulating the data organized by the appropriate data model DML also known as query language Two classes of languages 两类语言 Procedural user specifies what data is required and how to get those data Nonprocedural user specifies what data is required without specifying how to g
35、et those data SQL is the most widely used query language 最常用,过程式,怎么作,非过程式,要什么,Chapter 1: Introduction 概论,要点, 第一章 蜻蜓点水 预告内容 Purpose of Database Systems 目的 View of Data 数据视图 Database Languages 数据库语言 Relational Databases 关系数据库 Database Design 数据库设计 Object-based and semistructured databases 面向对象数据库 Data
36、 Storage and Querying 数据存储和查询 Transaction Management 事务管理 Database Architecture 数据库体系结构 Database Users and Administrators 用户和管理员 Overall Structure 总体结构 History of Database Systems 数据库历史,Relational Model 关系模型 通例 ep8,例 Example of tabular data in the relational model,customer- name,Customer-id,customer
37、- street,customer- city,account- number,Johnson Smith Johnson Jones Smith,192-83-7465 019-28-3746 192-83-7465 321-12-3123 019-28-3746,Alma North Alma Main North,Palo Alto Rye Palo Alto Harrison Rye,A-101 A-215 A-201 A-217 A-201,属性Attributes,顾客号 顾客名 街道 城市 账号 学会 用通例(running Example e 写书、写论文),A Sample
38、Relational Database 例 ep8,顾客表,储户,账号,1.6 Database Design,The process of designing the general structure of the database 四个层次上的考虑:: Logical Design 设计好的模式 Business decision 用户需要存什么(关系 字段) Computer Science decision 怎样在计算机中满足用户需求 Physical Design Deciding on the physical layout of the database,Entity-Rela
39、tionship Model 第6章详细讲,Example of schema in the entity-relationship model,实体 储户,联系:存款 常用动词或动宾结构,有联系两对象的自然语义,实体 账户,技巧:先画实体和联系,最后加属性,Entity-Relationship Model 第6章详细讲,Example of schema in the entity-relationship model 技巧:先画实体和联系,最后加属性,实体 储户,联系:存款 常用动词或动宾结构,有联系两对象的自然语义,属性,实体 账户,规范化 第7章详细讲,设计好的模式 。 思想是 多用
40、关系, 少用字段(一个关系中),1.7 Object-Relational Data Models,扩展 relational model by including object orientation and constructs to deal with added data typ 复杂属性 nested relations.,保留 关系数据库的基础 使得语言 向上兼容,XML: Extensible Markup Language (chp10),Defined by the WWW Consortium (W3C) Originally intended as a document
41、markup language not a database language The ability to specify new tags, and to create nested tag structures made XML a great way to exchange data, not just documents XML has become the basis for all new generation data interchange formats. A wide variety of tools is available for parsing, browsing
42、and querying XML documents/data,1.8 Storage Management 存储管理 cp13,Storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system. The storage manager is responsible to the following tas
43、ks: 存储管理员任务 interaction with the file manager 与管理员交互 efficient storing, retrieving and updating of data 高效存储,检索,更新,程序模块,管理员模块界面底层管理,1.8 Storage Management 存储管理,Storage manager is a program module that provides the interface between the low-level data stored in the database and the application progra
44、ms and queries submitted to the system. The storage manager is responsible to the following tasks: interaction with the file manager 与文件系统交互 efficient storing, retrieving and updating of data 高效存储,检索,更新,管理员任务 Cp17,1.8 Query Processing 查询处理,Key Points : 1. Parsing and translation 词法分析,转换 2. Optimizat
45、ion 优化 3. Evaluation 评价 求值,Query Processing (Cont.),Alternative ways of evaluating a given query Equivalent expressions Different algorithms for each operation Cost difference between a good and a bad way of evaluating a query can be enormous Need to estimate the cost of operations Depends criticall
46、y on statistical information about relations which the database must maintain Need to estimate statistics for intermediate results to compute cost of complex expressions,等价表达式,功能和算法,代价,1.9 Transaction Management 事务管理 cp13 Chap15,A transaction is a collection of operations that performs a single logi
47、cal function in a database application Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures. Concurrency-control manager controls the interaction among t
48、he concurrent transactions, to ensure the consistency of the database. 并发控制:忙而不错,目的: 忙而不错,事务,必须一气呵成的动作序列。逻辑上原子, 不可再分,1.9 Transaction Management 事务管理 cp 13 Chap15,A transaction is a collection of operations that performs a single logical function in a database application Transaction-management compo
49、nent ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures. Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the databa
50、se.,并发控制:忙而不错,1.11 Database Architecture,The architecture of a database systems is greatly influenced by the underlying computer system on which the database is running: Centralized Client-server Parallel (multi-processor) Distributed,ep17 Overall System Structure 总体结构,管理员,各种用户,查插删改应用,物理库,查询处理,存储管理,
51、Application Architectures 应用体系,Two-tier architecture: E.g. client programs using ODBC/JDBC to communicate with a database 两层结构 Three-tier architecture: E.g. web-based applications, and applications built using “middleware” 三层结构,等求而应有求必应,中间件,1.12 Database Users 用户,Users are differentiated by the way
52、they expect to interact with the system 用户类型 Application programmers interact with system through DML calls 程序员 Sophisticated users form requests in a database query language 复杂用户,高级用户 Specialized users write specialized database applications that do not fit into the traditional data processing fram
53、ework 特殊用户 Nave users invoke one of the permanent application programs that have been written previously 朴素用户。低级用户 E.g. people accessing database over the web, bank tellers, clerical staff,Database Users 用户,Users are differentiated by the way they expect to interact with the system 用户类型 Application
54、programmers interact with system through DML calls 程序员 Sophisticated users form requests in a database query language 复杂用户,高级用户 Specialized users write specialized database applications that do not fit into the traditional data processing framework 特殊用户 Nave users invoke one of the permanent applica
55、tion programs that have been written previously 朴素用户。低级用户 E.g. people accessing database over the web, bank tellers, clerical staff,1.12 Database Administrator 数据库管理员,Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprises informa
56、tion resources and needs. 最高权力 Database administrators duties include: 权力与任务 Schema definition 定义模式,存储结构,取方法 Storage structure and access method definition Schema and physical organization modification Granting user authority to access the database Specifying integrity constraints 给定完整性 Acting as li
57、aison with users 普通用户 Monitoring performance and responding to changes in requirements 监视性能 八字 :模储取物,权整用监,物理组织,授权,1.12 Database Administrator 数据库管理员,Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprises information resources and
58、 needs. 最高权力 Database administrators duties include: 权力与任务 Schema definition 定义模式,存储结构,取方法 Storage structure and access method definition Schema and physical organization modification Granting user authority to access the database Specifying integrity constraints 给定完整性 Acting as liaison with users 普通用户 Monitoring performance and responding to changes in requirements 监视性能 八字 :模储取物,权整用监,物理组织,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 智能化卫生间隔断研发与市场推广合同
- 党建工作信息化建设合作协议书
- 篮球场地租赁与广告合作合同
- 互联网企业云端办公用品租赁合同
- 餐饮运营减亏方案
- 庭院果树维护方案
- 智能仓储工厂废品回收押金合同模板
- 墙面拆除修补方案
- 月嫂培训考试题及答案
- 电商培训课程大纲
- 2025年湖北省中考物理试题(含答案及解析)
- 几何画板 培训课件
- 经皮肺动脉瓣置换术(TPVRPPVI)
- 中兴-5G-A高频毫米波网络规划方法论介绍V1.0
- 2025至2030中国时尚凉鞋行业项目调研及市场前景预测评估报告
- 2025年度滕王阁旅游区讲解员招聘6人笔试参考题库附带答案详解
- 红蓝黄光治疗皮肤病临床应用专家共识(2025版)解读
- 禁止小孩进入车间协议书
- 工程项目参与经历证明文件(8篇)
- 学校规范常规化管理
- 神经外科危重病人抢救流程
评论
0/150
提交评论