Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 14 Databases.

Similar presentations


Presentation on theme: "Chapter 14 Databases."— Presentation transcript:

1 Chapter 14 Databases

2 OBJECTIVES After reading this chapter, the reader should be able to:
Understand a DBMS and define its components. Understand the architecture of a DBMS and its levels. Distinguish between different database models. Understand the concept of relational database operations on a relation. Use Structured Query Language (SQL) to define simple relations.

3 Contents 14.1 Database management system 14.2 Architecture
14.3 database Models 14.4 Relational Model 14.5 Operations on Relations 14.6 Structured Query Language 14.7 Other Database Models Summary

4 14.1 DATABASE MANAGEMENT SYSTEM

5 Key terms Database(数据库):数据逻辑上的集合,而不强调其在物理上的相关。
Database management system(DBMS):数据库管理系统,是定义(define)、创建(create)、维护(maintain)数据库的一种工具。

6 Figure 14-1 DBMS components 硬件 软件 数据 用户 规程

7 Key terms user(用户) (1)End user(最终用户):直接从数据库中获取信息的人。包括:database administrator(DBA)—数据库管理员,以及normal user—普通用户。 (2)Application programs(应用程序):

8 14.2 ARCHITECTURE

9 Key terms Architecture:体系结构。 (1)Internal Level:内层,直接与硬件交互
(2)Conceptual level:概念层,定义数据的逻辑视图(logical view) (3)External level:外层,直接与用户交互

10 Figure 14-2 Database architecture

11 14.3 DATABASE MODELS

12 Hierarchical model(层次模型)
Figure 14-3 Hierarchical model(层次模型)

13 Figure 14-4 Network model(网络模型)

14 Relational model(关系模型)
Figure 14-5 Relational model(关系模型)

15 14.4 RELATIONAL MODEL

16 Figure 14-6 Relation 属性 元组 名称

17 14.5 OPERATIONS ON RELATIONS

18 Insert operation(插入操作)
Figure 14-7 Insert operation(插入操作)

19 Delete operation(删除操作)
Figure 14-8 Delete operation(删除操作)

20 Update operation(更新操作)
Figure 14-9 Update operation(更新操作)

21 Select operation(选择操作)
Figure 14-10 Select operation(选择操作)

22 Project operation(投影操作)
Figure 14-11 Project operation(投影操作)

23 Figure 14-12 Join operation(连接操作)

24 Figure 14-13 Union operation(并操作)

25 Intersection operation(交操作)
Figure 14-14 Intersection operation(交操作)

26 Difference operation(差操作)
Figure 14-15 Difference operation(差操作)

27 14.6 STRUCTURED QUERY LANGUAGE

28 Key terms Structured Query Language(SQL):结构化查询语言。用于关系数据库的标准语言。

29 insert into RELATION-NAME values (…,…,…)
结构化查询语言 插入(Insert) insert into RELATION-NAME values (…,…,…) insert into COURSES values (“CIS52”,”TCP/IP Protocols”,6)

30 delete from RELATION-NAME where criteria
结构化查询语言 删除(delete) delete from RELATION-NAME where criteria delete from COURSES where No=“CIS19”

31 update COURSES set Unit=6 where NO=“CIS51” 结构化查询语言 update RLATION-NAME
set attribute1=value1 attribute2=value2,… where criteria update COURSES set Unit=6 where NO=“CIS51”

32 select * from COURSES where Unit=5 选择(select) 结构化查询语言 select *
from RELATION-NAME where criteria select * from COURSES where Unit=5

33 select attribute-list from RELATION-NAME
结构化查询语言 投影(project) select attribute-list from RELATION-NAME select No,Unit from COURSES

34 select No,Course-Name, Unit, Professor from COURSES,TAUGHT-BY
结构化查询语言 连接(join) select attribute-list from RELATION1, RELATION2 where criteria select No,Course-Name, Unit, Professor from COURSES,TAUGHT-BY where COURSES.No=TAUGHT-BY.Bo;

35 select * from CIS15-Roster union select * from CIS52-Roster; 结构化查询语言
from RELATION1 union from RELATION2 select * from CIS15-Roster union select * from CIS52-Roster;

36 select * from CIS15-Roster intersection select * from CIS52-Roster;
结构化查询语言 交(Intersection) select * from RELATION1 intersection from RELATION2 select * from CIS15-Roster intersection select * from CIS52-Roster;

37 select * from CIS15-Roster minus select * from CIS52-Roster; 结构化查询语言
差(Difference) select * from RELATION1 minus from RELATION2 select * from CIS15-Roster minus select * from CIS52-Roster;

38 14.7 OTHER DATABASE MODELS

39 Key terms Distributed databases:分布式数据库模型。
基于关系模型;数据存储在通过互联网通信的计算机上。 Object-Oriented Databases:面向对象数据库。

40 Summary 数据库是数据在逻辑上的集合,而不强调其在物理上的相关。 • 数据库管理系统(DBMS)定义、创建、维护数据库,并且控制用户对数据库的存取。 数据库管理系统由硬件、软件、数据、用户和规程组成。 • 数据库管理系统的用户可以是人也可以是应用程序。 • 数据库管理系统有三个层次:内层、概念层、外层。

41 Summary 数据库管理系统的内层直接与硬件交互。外层直接与用户交互。概念层定义了数据的逻辑视图以及数据模型和模式图表。 • 关系数据库管理系统是目前广泛应用的数据库模型。 关系可以被认为是二维表,每一列称为属性,每一行称为元组。

42 Summary • 在一个关系上进行的操作叫一元操作。包括:插入、删除、更新、选择、投影。 在两个关系上进行的操作叫二元操作。包括:连接、并、交、差。 • 结构化查询语言(SQL)是由ANSI和ISO定义的标准化语言,用于关系数据库。


Download ppt "Chapter 14 Databases."

Similar presentations


Ads by Google