77777777777

Unit 7 Database

7.1 An Overview of a Database System

Let us consider an enterprise, such as an airline, that has a large amount of data kept for long periods of time in a computer.

让我们考虑一个企业,如航空公司,在计算机中长期保存大量数据。

This data might include information about passengers.

这些数据可能包括有关乘客的信息。

flights, aircraft, and personnel, for example. Typical relationships that might be represented include bookings (which passengers have seats on which flights?) flight crews (who is to be the pilot, copilot, etc., on which flights?), and service records (when and by whom was each aircraft last serviced?).

例如,航班、飞机和人员。可能代表的典型关系包括预订(哪些乘客在哪些航班上有座位?)机组人员(谁是飞行员、副驾驶等,在哪些航班?)和服务记录(每架飞机最后一次服务的时间和人员?)。

Data, such as the above, that is stored more-or-less permanently in a computer we term a database.

数据,如上述,或多或少地永久存储在计算机中,我们称之为数据库。

The software that allows one or many persons to use and/or modify this data is a database management system (DBMS).

允许一个人或多个人使用和/或修改该数据的软件是数据库管理系统(DBMS)。

The primary goal of a DBMS is to provide an environment that is both convenient and efficient to use in retrieving information from and storing information into the database.

DBMS的主要目标是提供一种既方便又高效的环境,用于从数据库中检索信息并将信息存储到数据库中。

Data Abstraction

数据抽象

It should be obvious that between the computer, dealing with bits, and the ultimate user dealing with abstractions such as flights or assignment of personnel to aircraft, there will be many levels of abstraction.

很明显,在处理比特的计算机和处理抽象(如航班或飞机人员分配)的最终用户之间,将有许多抽象级别。

 A fairly standard viewpoint regarding levels of abstraction is shown in Figure 7-1.

关于抽象级别的一个相当标准的观点如图7-1所示。

 There we see a single database, which may be one of many databases using the same DBMS software, at three different levels of abstraction.

在那里,我们看到了一个单一的数据库,它可能是使用相同DBMS软件的许多数据库中的一个,处于三个不同的抽象级别。

The lowest level, i.e., the physical level has the data stored on hardware devices.

最低级别,即物理级别,具有存储在硬件设备上的数据。

User programs cannot access them directly.

用户程序无法直接访问它们。

They have to go through the logical level to access the data, The external level defines the different views of the database as required by the external or user programs.

它们必须通过逻辑级别才能访问数据。外部级别定义了外部或用户程序所需的数据库的不同视图。

One user program may not require all the data in the database.

一个用户程序可能不需要数据库中的所有数据。

 Hence the user/application programs view only the required information from the database.

因此,用户/应用程序仅查看来自数据库的所需信息

That means different programs will have different views of the database depending on their requirement of data.

这意味着不同的程序将根据其对数据的需求对数据库有不同的视图。

Such views are external to the database and are specified at the external level.

这些视图在数据库外部,并且是在外部级别指定的。

 Also it is not necessary that different views should contain altogether different data.

此外,不同的视图不必包含完全不同的数据。

There can be common information in different views.

在不同的视图中可以有共同的信息。

The conceptual level describes the entire database. It is used by database administrators, who must decide what information is to be kept in the database.

概念级别描述整个数据库。它由数据库管理员使用,他们必须决定将哪些信息保存在数据库中。

Data Models.

数据模型。

A data model is a collection of conceptual tools for describing data, data relationships, data semantics and data constraints.

数据模型是用于描述数据、数据关系、数据语义和数据约束的概念工具的集合。

 The data models are divided into three classes, viz., object-based logical models, record-based logical models and physical data models.

数据模型分为三类,即基于对象的逻辑模型、基于记录的逻辑模型和物理数据模型。

Object-based logical models are used for describing data at the conceptual and view levels.

基于对象的逻辑模型用于在概念和视图级别描述数据。

They are very close to human logic.

它们非常接近人类的逻辑。

Many different models are available to describe object-based logical models.

许多不同的模型可用于描述基于对象的逻辑模型。

The most important among them are semantic data model and entity-relationship model.

其中最重要的是语义数据模型和实体关系模型。

 Semantic data model provides a facility for expressing meaning about the data in the database.

语义数据模型为表达数据库中数据的含义提供了便利。

The Entity-Relationship model (E-R model) is based on a perception of a real world which consists of a collection of objects called entities and relationships among these objects.

实体关系模型(E-R模型)基于对真实世界的感知,真实世界由称为实体的对象集合以及这些对象之间的关系组成。

An entity is an object, which can be uniquely distinguished from other objects.

实体是一个对象,它可以与其他对象唯一区分。

For instance, the designation, physical dimensions and weight per unit length uniquely describe a particular rolled steel section.

例如,名称、物理尺寸和单位长度重量唯一地描述了特定的轧制钢型材。

The set of all entities of the same type and relationships of the same type are termed as entity set and relationship set respectively. Examples of entity set are:

所有相同类型的实体和相同类型的关系的集合分别称为实体集和关系集。实体集的示例有:

all rooms in a building

建筑物中的所有房间

all elements in a finite element mesh

有限元网格中的所有元素

all bearings in a machine

机器中的所有轴承

Entities and relationships are to be distinguished and a database model should specify how this can be carried out.

实体和关系需要区分,数据库模型应指定如何进行区分。

This is achieved using the concept of primary key.

这是使用主键的概念实现的。

An entity-relationship model may define certain constraints to which the contents of a database must confirm.

实体关系模型可以定义数据库的内容必须确认的某些约束。

One important constraint is the number of entities to which another entity can be associated via a relationship.

一个重要的约束是另一个实体可以通过关系与之关联的实体的数量。

 For relationships involving two entity sets, there can be relationships like one-to-one, one-to-many, many-to-one and many-to-many.

对于涉及两个实体集的关系,可以有一对一、一对多、多对一和多对多等关系。

Schematic representation of these relationships are shown in Figure 7-2.

这些关系的示意图如图7-2所示。

Record-based logical models define the overall logical structure of the database as well as higher level description of its implementation.

基于记录的逻辑模型定义了数据库的总体逻辑结构以及对其实现的更高级别描述。

 Three different record-based logical models are widely used. They are:

三种不同的基于记录的逻辑模型被广泛使用。它们是:

  1. Hierarchical Model

层次模型

  1. Network Model

网络模型

  1. Relational Model

关系模型

Physical data models are used to describe data at the lowest level. There are very few physical data models in use.Some of the widely known ones are:

物理数据模型用于描述最低级别的数据。使用的物理数据模型很少。其中一些广为人知的是:

  1. Unifying model

统一模型

  1. Frame memory

帧存储器

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值