约 660 个字 预计阅读时间 3 分钟
欢迎!
复习时的一些补充
-
What Is a Database? 长期存储在计算机内、有组织的、可共享的数据集合 A collection of information that exists over a long period of time, often many years
-
Characteristics of DBMS
- Efficiency and scalability in data access.
- Reduced application development time.
- Data independence (including physical data independence and logical data independence).
- Data integrity and security.
- Concurrent access and robustness (i.e., recovery).
- data files may be in different formats. Data files are independent each other.
-
- Data redundancy and inconsistency Multiple file formats, duplication of information in different files
Drawbacks of File-Processing System (文件处理系统的缺点)
-
Difficulty in accessing data Need to write a new program to carry out each new task
-
Data isolation — multiple files and multiple formats Difficult to retrieve, difficult to share
-
Integrity problems Integrity constraints (e.g. account balance > 0) become part of program code Hard to add new constraints or change existing ones
-
No atomicity of updates
-
Difficult to concurrent access by multiple users
-
Security problems (i.e., Right person uses right data)
Database systems offer solutions to all the above problems!
-
Different usage needs different level of abstraction
- Physical level
- Logical level
- View level
-
Schema – the structure of the database on different level
- Analogous to type information of a variable in a program
- Physical schema: database structure design at the physical level
- Logical schema: database structure design at the logical level
- Subschema: schema at view level
类似于程序中变量的类型信息
物理模式:物理级别的数据库结构设计
逻辑架构:逻辑级别的数据库结构设计
子架构:视图级别的架构
-
Instance(实例) – the actual content of the database at a particular point in time Analogous to the value of a variable 数据库在特定时间点的实际内容,类似于变量的值
Similar to types and variables in programming languages
type ↔ schema, variable ↔ instance
-
Ability to modify a schema definition at one level without affecting a schema definition at a higher level. 能够在一个级别上修改架构定义,而不会影响更高级别的架构定义。
-
Physical data independence – the ability to modify the physical schema without changing the logical schema.
- Applications depend on the logical schema.应用程序依赖于逻辑架构。
- Applications are insulated from how data is structured and stored.应用程序与数据的结构化和存储方式无关。
- One of the most important benefits of using a DBMS!
-
Logical data independence – protect application programs from changes in logical structure of data.
- Logical data independence is hard to achieve as the application programs are heavily dependent on the logical structure of data. 应用程序严重依赖于数据的逻辑结构。
-
-
数据库语言
- 数据定义语言 (DDL):用于定义数据库架构的规范表示法。CREATE
- 数据操作语言 (DML):用于访问和操作按适当数据模型组织的数据的语言。Insert / delete / update
- 数据控制语言 (DCL)
-
Steps of Database Design
-
Requirement analysis
-
Conceptual database design
-
Logical database design
-
Schema refinement
-
Physical database design
-
Create and initialize the database & Security design
-
-
Storage Manager includes
- Transaction manager
- Authorization and integrity manger
- File manager (interaction with the file system to process data files, data dictionary, and index files)
- Buffer manager
- Query Processor includes DDL interpreter, DML compiler, and query processing.