charter 1 :Introduction
1、Outline(大纲)
<1> The Need for Databases(对数据库的要求)
<2> Data Models(数据模型)
<3> Relational Databases(关系数据库)
<4> Storage Manager(存储管理器)
<5> Query Processing(查询处理器)
<6> Transcation Manager(事务管理)
2、 Data Explosion(数据爆炸)
3、Database Management System(DBMS)
① Database is collection of interrelated data, logically coherent
数据库是逻辑上相互关联的数据的集合
② DBMS contains information about a particular enterprise
DBMS包含一个特定企业的信息
- Set of programs to create database, access and manipulate the data
用于创建数据库、访问和操作数据的程序集 - An environment that is both convenient and efficient to use
一个既方便又高效的使用环境
Database Applications:
(数据库的应用:)
- Banking: transactions
(银行业务:交易) - Airlines: reservations, schedules
(航空公司:预订、时刻表) - Universities: registration, grades
(大学:注册,成绩)
-Sales: customers, products, purchases
(销售:客户、产品、采购) - Online retailers: order tracking, customized recommendations
(在线零售商:订单跟踪、定制推荐) - Manufacturing: production, inventory, orders, supply chain
(制造:生产、库存、订单、供应链) - Human resources: employee records, salaries, tax deductions
(人力资源:员工记录、工资、税收减免)
Databases can be very large.
数据库可能非常大
Databases touch all aspects of our lives
数据库涉及我们生活的方方面面
4、File systems VS .DBMS
6、University Database Example
大学数据库示例
① In the early days, database applications were built directly on top of file systems
早期,数据库应用程序直接构建在文件系统之上
② Application program examples(应用程序示例)
- Add new students, instructors, and courses
添加新学生、教师和课程 - Register students for courses, and generate class rosters
为学生注册课程,并生成班级名册 - Assign grades to students, compute grade point averages (GPA) and generate transcripts
为学生分配成绩、计算平均绩点 (GPA) 并生成成绩单
7、Comparison of DBMS and File base appoarch
DBMS 和基于文件的方法的比较
DBMS | File |
---|---|
DBMS contains both data and database structure(DBMS 包含数据和数据库结构) | The data is stored in the file whereas the data structure is stored in the application(数据存储在文件中,而数据结构存储在应用程序中) |
Changing the structure requires updating the catalog not the application(更改结构需要更新目录而不是应用程序) | The change of the data structure of the file occurs at the application level(文件数据结构的变化发生在应用层) |
Multiple user can access the data allowing concurrency control(允许多个用户访问并发控制数据) | It is not possible to have multiple user accessing the same data(不可能有多个用户访问相同的数据) |
8、Drawbacks of using file systems to store data
使用文件系统存储数据的缺点
① Data redundancy and inconsistency
数据冗余和不一致
- Multiple file formats, duplication of information in different files
- 多种文件格式,不同文件中的信息重复
② Difficulty in accessing data ( 数据访问困难)
- Need to write a new program to carry out each new task
需要编写一个新程序来执行每个新任务
③ Integrity problems (诚信问题)
- Integrity constraints (e.g., account balance > 0) become “buried” in program code rather than being stated explicitly
完整性约束(例如,账户余额 > 0)被“隐藏”在程序代码中,而不是被明确声明 - Hard to add new constraints or change existing ones
难以添加新约束或更改现有约束
9、Drawbacks of using file systems to store data (Cont.)
使用文件系统存储数据的缺点(续)
① Atomicity of updates
更新异常
- Failures may leave database in an inconsistent state with partial updates carried out
失败可能会使数据库处于不一致的状态,并执行了部分更新 - Example: Transfer of funds from one account to another should either complete or not happen at all
示例:资金从一个账户转移到