1 基本概念
数据Data
数据库DataBase
数据库系统DataBaseSystem
数据库管理系统DataBaseManageSystem
其中,数据库系统DBS = 数据库DB + 数据库管理系统DBMS+User/Administrators
2发展历程
- 数据库发展:人工管理>>文件系统>>数据库系统
- 数据库系统和文件系统根本区别:数据的结构化
- 用文件系统的缺陷(这些缺陷database system都解决了w)
- Data redundancy and inconsistency
- Difficulity in accessing data
- Data isolation
- Integrity problems
- Atomicity of updates
- Concurrent access by multiple users
- Security problems
3 三层schema两层映射
- 视图层 View Level->Conceptual schema
- 某一用户能看到和处理的数据,是全局数据的一部分
- ER 模型
||E-C mapping映射
- 逻辑层 Logical Level->Logical schema
- 从全局角度理解/管理数据,包括相应关系约束
- 关系模型
- 网状模型,层次模型,基于对象的数据模型,半结构化数据模型等等
||C-I mapping映射
- 物理层 Physical level->Physical schema
- 对数据最底层的抽象。描述存储在介质上的数据,包括存储路径,存储方式,etc.
- B*树模型
其中两层映射从下向上分别保证了两个独立性——
- 物理数据独立性
- 用户的应用程序和数据库中数据的物理存储相互独立
- 当物理存储改变,用户应用程序不受影响
- 逻辑数据独立性
- 用户应用程序与数据库逻辑结构相互独立
- 当数据逻辑结构改变,应用程序不改变。
4 数据库的功能
- 用户的角度
- 数据库定义功能——DDL
- 数据库管理功能——DML
- Procedural DML
- User specifies what data is required and how to get these data
- Declarative DML
- User specifies what data is required without specifying how to get those data
- Procedural DML
- 数据库维护——DBA
- 系统的角度