计算机专业英语Unit06SectionADatabaseOverview.ppt_第1页
计算机专业英语Unit06SectionADatabaseOverview.ppt_第2页
计算机专业英语Unit06SectionADatabaseOverview.ppt_第3页
计算机专业英语Unit06SectionADatabaseOverview.ppt_第4页
计算机专业英语Unit06SectionADatabaseOverview.ppt_第5页
已阅读5页,还剩44页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Unit 6 Database Section A Database Overview,2/45,I. Introduction,Data storage traditionally used individual, unrelated files, sometimes called flat files. In the past, each application program in an organization used its own file. In a university,for example, each department might have its own set of files: the record office kept a file about the student information and their grades, the financial aid office kept its own file about students that needed financial aid to continue their education,,一、引言 数据存储传统上是使用单独的没有联系的文件,这些文件有时称为平面文件。在过去,一个机构中的每个应用程序都使用自己的文件。例如,在一个大学中,每个部门都可能有其自己的文件集:档案办公室保存着关于学生信息和学生成绩的文件;经济资助办公室保存着其自己的关于需要经济资助以继续学业的学生的文件;,3/45,I. Introduction,the scheduling office kept the names of the professors and the courses they were teaching, the payroll department kept its own file about the whole staff (including professors), and so on. Today, however, all of these flat files can be combined in a single entity, the database for the whole university.,调度办公室保存着教授的姓名和他们所教的课程;工薪发放部门保存着其自己的关于全体教职员工(包括教授)的文件,等等。然而,所有这些平面文件今天都可结合成一个实体供整个大学使用的数据库。,4/45,I. Introduction,Although it is difficult to give a universally agreed definition of a database, we use the following common definition:a database is a collection of related, logically, coherent data used by the application programs in an organization.,虽然难以给出一个普遍接受的数据库定义,但我们使用下面常见的定义:一个数据库是被一个机构内的应用程序所使用的具有逻辑相干性的相关数据的集合。,adj., 粘在一起的, 一致的, 连贯的 a coherent essay. 一篇条理分明的文章,5/45,Database Management Systems,A database management system (DBMS) defines, creates, and maintains a database. The DBMS also allows controlled access to data in the database. A DBMS is a combination of five components:hardware, software, data, users, and procedures.,数据库管理系统定义、创建和维护数据库。数据库管理系统也允许对数据库中的数据进行受控的访问。一个数据库管理系统由5个组成部分构成:硬件、软件、数据、用户和规程。,6/45,Database Management Systems,1Hardware The hardware is the physical computer system that allows access to data. For example,the terminals, hard disk,main computer and workstations are considered part of the hardware in a DBMS.,1、硬件硬件是指允许访问数据的计算机物理系统。例如,终端、硬盘、主机和工作站被认为是数据库管理系统的硬件组成部分。,7/45,Database Management Systems,2Software The software is the actual program that allows users to access,maintain, and update data. In addition, the software controls which user can access which parts of the data in the database.,2、软件软件是指允许用户访问、维护和更新数据的实际程序。另外,软件还控制着哪个用户可以对数据库中的哪部分数据进行访问。,8/45,Database Management Systems,3Data The data in a database is stored physically on the storage device. In a database, data is a separate entity from the software that accesses it. This separation allows an organization to change the software without having to change the physical data or the way in which it is stored.,3、数据数据库中的数据存储在物理存储设备上。在一个数据库中,数据是独立于对其进行访问的软件的一个实体。这种独立使一个机构可以在不必更改物理数据及其存储方式的情况下更改软件。,9/45,Database Management Systems,If an organization decides to use a DBMS,then all the information needed by the organization should be kept together as one entity, to be accessible by the software in the DBMS.,如果一个机构决定使用一个数据库管理系统,那么该机构所需要的所有信息都应作为一个实体保存在一起,可由数据库管理系统中的软件访问。,10/45,Database Management Systems,4. Users The term user in a DBMS has a broad meaning. We can divide users into two categories: end users and application programs. End users are those humans who can access the database directly to get information. There are two types of end users database administrators (DBAs) and normal users.,4、用户 在数据库管理系统中,用户这个术语有着广泛的定义。我们可以将用户分为两类:最终用户和应用程序。最终用户是指可直接访问数据库以获取信息的人。最终用户又分为两类:数据库管理员和普通用户。,adj., 宽的, 阔的, 广泛的 a broad river; broad shoulders. 宽广的大河;宽阔的双肩 abroad, adv., 往国外, 到处, 海外 go abroad 出国,11/45,Database Management Systems,Database administrators have the maximum level of privileges and can control other users and their access to the DBMS, grant some of their privileges to somebody else, but retain the ability to revoke them at any time. A normal user, on the other hand,can only use part of the database and has limited access.,数据库管理员拥有最高程度的特权,可以控制其他用户及其对数据库管理系统的访问,可以将其某些特权授予其他人并保留随时收回这些特权的能力。另一方面,普通用户只能使用数据库的一部分,只能进行有限的访问。,vt., 同意, 准予, 承认(某事为真) n., 补助金;助学金;赠款;津贴 The government gave us a grant to build another classroom. 政府给了我们一笔补助,用来盖另外一间教室。,vt., 撤回, 废除, 宣告无效 Her license was revoked. 她的执照被吊销,12/45,Database Management Systems,The other users of data in a database are application programs. Applications need to access and process data. For example, a payroll application program needs to access part of the data in a database to create paychecks at the end of the month.,数据库中数据的其他用户就是应用程序。应用程序需要访问和处理数据。例如,工薪发放应用程序需要在月底访问数据库中的部分数据,来开支付工薪的支票。,13/45,Database Management Systems,5Procedures The last component of a DBMS is a set of procedures or rules that should be clearly defined and followed by the users of the database.,5、规程数据库管理系统的最后一个组成部分就是应该明确定义并为数据库用户所遵循的一套规程或规则。,14/45,. Database Architecture,The American National Standards Institute Standards Planning and Requirements Committee (ANSI/SPARC) has established a three-level architecture for a DBMS: internal, conceptual, and external (Figure 6A-1) .,三、数据库体系结构 美国国家标准协会标准计划与需求委员会(ANSI/SPARC)为数据库管理系统确立了一个包含3个层次的体系结构:内层、概念层和外层。,15/45,Hardware,Figure 6A-1: Database Architecture,User View,User View,User View,External View,Conceptual View,Internal View,16/45,. Database Architecture,1. Internal Level The internal level determines where data is actually stored on the storage devices. This level deals with low level access methods and how bytes are transferred to and from storage devices. In other words, the internal level interacts directly with the hardware.,1、内层内层决定数据在存储设备上的实际存储位置。该层涉及低级访问方法,以及字节如何传向和传自存储设备。换句话说,内层直接与硬件交互。,17/45,. Database Architecture,2. Conceptual Level The conceptual level defines the logical view of the data. The data model is defined on this level, and the main functions of the DBMS, such as queries,are also on this level. The DBMS changes the internal view of data to the external view that users need to see. The conceptual level is an intermediary and frees users from dealing with the internal level.,2、概念层概念层定义数据的逻辑视图。数据模型在该层定义,数据库管理系统的主要功能如查询也在该层。数据库管理系统把数据的内部视图转化为用户需要看到的外部视图。概念层是中介层,它使得用户不必与内层打交道。,18/45,. Database Architecture,3. External Level The external level interacts directly with the user (end users or application programs). It changes the data coming from the conceptual level to a format and view that is familiar to the users.,3、外层外层直接与用户(最终用户或应用程序)交互。它将来自概念层的数据转化为用户所熟悉的格式和视图。,19/45,IV. Database Models,A database model defines the logical design of data. The model also describes the relationships between different parts of the data. In the history of database design,three models have been in use: the hierarchical model, the network model,and the relational model.,数据库模型定义数据的逻辑设计。它也描述数据的不同部分之间的关系。在数据库设计史上,使用过3种数据库模型:层次模型、网络模型和关系模型。,20/45,IV. Database Models,1. Hierarchical Database Model In the hierarchical model, data is organized as an inverted tree, each entity has only one parent but can have several children. At the top of the hierarchy, there is one entity, which is called the root. Figure 6A-2 shows a logical view of an example of the hierarchical model. The hierarchical model is now obsolete.,1、层次数据库模型在层次模型中,数据被组织成一棵倒置的树。每个实体只有一个父,但可有数个子。在分层结构的顶部,有一个实体,称为根。图6A-2给出了一个层次模型例子的逻辑视图。层次模型现在已经过时。,invert: vt., 使颠倒, 使转化 convert: vt., 使转变, 转换.,使.改变信仰 revert: vi., (与to连用)恢复原状;回复;回到(原来话题),adj., 荒废的, 陈旧的 an obsolete word 已废的词,21/45,Figure 6A-2: An Example of the Hierarchical Model Representing a University,No.,Name,No.,Name,No.,Name,ID,Name,Unit,Unit,Department,Courses,Students,Professors,22/45,IV. Database Models,2. Network Database Model In the network model, the entities are organized in a graph, in which some entities can be accessed through several paths (Figure 6A-3). There is no hierarchy. This model is now also obsolete.,2、网络数据库模型 在网络模型中,实体以图的形式来组织,图中的有些实体可通过多条路径访问。网络模型没有分层结构。这种模型现在也已经过时。,23/45,Figure 6A-3: An Example of the Network Model Representing a University,No.,Name,No.,Name,No.,Name,ID,Name,Unit,Unit,Department,Courses,Students,Professors,24/45,IV. Database Models,3. Relational Database Model In the relational model, data is organized in two-dimensional tables called relations. There is no hierarchical or network structure imposed on the data. The tables or relations are, however, related to each other (Figure 6A-4).,3、关系数据库模型 在关系模型中,数据被组织成称为关系的二维表。关系模型没有分层或网络结构强加于数据。然而,表或关系是相互关联的。,25/45,Figure 6A-4: An Example of the Relational Model Representing a University,Department,Courses,Students,Professors,26/45,IV. Database Models,The relational database management system (RDBMS) organizes the data so that its external view is a set of relations or tables. This does not mean that data is stored as tables: the physical storage of the data is independent of the way in which the data is logically organized.,关系数据库管理系统组织数据,使其外部视图呈现为关系或表的集合。这并不意味着数据以表的形式存储:数据的物理存储与数据的逻辑组织方式毫无关系。,27/45,IV. Database Models,Figure 6A-5 shows an example of a relation. A relation in an RDBMS has the following features: Name. Each relation in a relational database should have a name that is unique among other relations.,图6A-5给出了一个关系的例子。关系数据库管理系统中的关系具有以下特征: 名称。关系数据库中的每个关系都应具有一个名称,而这个名称在所有关系中是独一无二的。,28/45,Figure 6A-5: An Example of a Relation,Attributes,Tuples,Courses,29/45,IV. Database Models,Attributes. Each column in a relation is called an attribute. The attributes are the column headings in the table in Figure 6A-5. Each attribute gives meaning to the data stored under it. Each column in the table must have a name that is unique in the score of the relation. The total number of attributes for a relation is called the degree of the relation.,属性。关系中的每一列都称为一个属性。在图6A-5的表中,属性是列的标题。每个属性赋予存储在其下面的数据以意义。表中的每一列都必须具有一个在关系的范围内独一无二的名称。一个关系的属性总数称为该关系的度。,30/45,IV. Database Models,For example, in Figure 6A-5,the relation has a degree of 3. Note that the attribute names are not stored in the database: the conceptual level uses the attributes to give meaning to each column.,例如,在图6A-5中,关系的度为3。注意属性名并不存储在数据库中:概念层使用属性给每一列赋予一定的意义。,31/45,IV. Database Models,Tuples. Each row in a relation is called a tuple. A tuple defines a collection of attribute values. The total number of rows in a relation is called the cardinality of the relation. Note that the cardinality of a relation changes when tuples are added of deleted. This makes the database dynamic.,元组。关系中的每一行称为一个元组。元组定义一组属性值。一个关系中的总行数称为该关系的基数。注意一个关系的基数随着元组的增加或删除而改变。这使数据库具有了动态性。,32/45,IV. Database Models,The relational model is one of the common models in use today. The other two common models that are derived from the relational model are the distributed model and the object-oriented model.,关系模型是今天使用的常见模型之一。源自关系模型的另外两种常见模型是分布式模型和面向对象模型。,33/45,IV. Database Models,4. Distributed Database Model The distributed database model is not a new model, but is based on the relational model. However, the data is stored on several computers that communicate through the Internet or a private wide area network.,4、分布式数据库模型 分布式数据库模型并非一种新模型,而是基于关系模型的。但是,数据存储在通过因特网或专用广域网通信的数台计算机上。,34/45,IV. Database Models,Each computer (or site) maintains either part of the database or the whole database. In other words,data is either fragmented, with each fragment stored at one site,or data is replicated at each site.,每台计算机(或站点)保持数据库的一部分或整个数据库。换句话说,数据或者是分段存储的每个站点存储一段,或者被每个站点复制一份,35/45,IV. Database Models,In a fragmented distributed database,data is localized - locally used data is stored at the corresponding site. However, this does not mean that a site cannot access data stored at another site, but access is mostly local, but occasionally global. Although each site has complete control over its local data, there is global control through the internet or a wide area network.,在分段型分布式数据库中,数据是本地化的,本地使用的数据存储在相应的站点上。然而,这并不意味着一个站点不能访问存储在另一个站点上的数据,但访问大多是本地性的,偶尔是全局性的。虽然每个站点对其本地数据具有完全的控制,但也存在通过因特网或广域网的全局控制。,36/45,IV. Database Models,For example,a pharmaceutical company may have multiple sites in many countries. Each site has a database with information about its own employees, but a central personnel department could have control of all the databases.,例如,一家制药公司可能在许多国家拥有多个站点。每个站点有一个数据库,存储着自己雇员的信息。但是,中心人事部门可以控制所有的数据库。,37/45,IV. Database Models,In a replicated distributed database,each site holds all exact replica of another site. Any modification to data stored in one site is repeated exactly at every site. The reason for having such a database is security. If the system at one site fails,users at the site can access data at another site.,在复制型分布式数据库中,每个站点都有其他站点的一个完全副本。对一个站点所存储的数据进行的任何修改,都要在其他每个站点上精确地重复进行。拥有这种数据库是为了安全。如果一个站点上的系统发生故障,该站点的用户可以访问另一个站点上的数据。,38/45,IV. Database Models,5. Object-Oriented Database Model The relational database has a specific view of data that is based on the nature of the databases tuples and attributes. The smallest unit of data in a relational database is the intersection of a tuple and an attribute. However, some applications need to look at data as other forms, for example, to see data as a structure, such as a record composed of fields.,5、面向对象数据库模型 关系数据库具有一个特定的数据视图,该视图基于数据库元组与属性的性质。关系数据库中最小的数据单位是一个元组与一个属性的交集。然而,有些应用程序需要将数据视为其他形式,如看作一种结构,像由字段构成的记录。,39/45,IV. Database Models,An object-oriented database tries to keep the advantages of the relational model and at the same time allows applications to access structured data. In an Object-Oriented database, objects and their relations are defined. In addition, each object can have attributes that can be expressed as fields.,面向对象数据库试图保留关系模型的优点,同时允许应用程序访问结构化数据。在面向对象数据库中,对象及其之间的关系得到定义。此外,每个对象可以具有可表示为字段的属性。,40/45,IV. Database Models,For example, in an organization, one could define object types for employee, department, and customer. The employee class could define the attributes of an employee object (first name, last name, social security number, salary, and so on) and how they can be accessed.,例如,在一个机构中,可以为雇员、部门和客户定义对象类型。雇员类可以定义一个雇员对象的属性(名、姓、社会保险号码、薪水等等),以及可以如何访问它们。,41/45,IV. Database Models,The department object could define the attributes of the department and how they can be accessed. In addition, the database could create a relation between employee object and a department object to denote that the employee works in that department.,部门对象可以定义部门的属性,以及可以如何访问它们。此外,数据库还可以在一个雇员对象与一个部门对象之间创建一种关系,以表示该雇员在该部门工作。,42/45,. Database Design,The design of any database is a lengthy and involved task that can only be done through a step-by-step process. The first step normally involves a lot of interviewing of potential users of the database to collect the information needed to be stored and the access requirement of each department.,任何数据库的设计都是一项冗长、复杂的任务,只能通过一个逐步的过程来完成。第一步通常涉及对数据库潜在用户的大量访谈,以收集需要存储的信息和每个部门的访问需求。,43/45,. Database Design,The second step is to build an Entity-Relationship Model (ERM) that defines the entities for which some information must be maintained, the attributes of these entities, and the relationship between these entities.,第二步是建立一个实体关系模型,该模型定义必须为之保存一些信息的实体、这些实体的属性以及这些实体之间的关系。,44/45,. Database Design,The next step in design is based on the type of database to be used. In a relational database, the next step is to build relations based on the ERM and normalize the relations. Normalization is the process by which a given set of relations are transformed to a new set of relations with a more solid structure.,设计的下一步基于所要使用的数据库的类型。在关系数据库中,下一步是建立基于实体关系模型的关系,并规范化这些关系。规范化是一个过程,通过该过程一组特定的关系转化成一组具有更坚固结构的新关系。,45/45,. Database Design,Normalization is needed to allow any relation in the database to be represented, to allow a language like SQL to use powerful retrieval operations composed of atomic operations, to remove anomalies in insertion, deletion, and updat

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论