




已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
装订线安徽工业大学工商学院 毕业设计(论文)说明书附录二:英汉翻译一、英文原文structure of the relational databasedatabase system conceptspart1: relational databasesthe relational model is the basis for any relational database management system (rdbms).a relational model has three core components: a collection of objects or relations, operators that act on the objects or relations, and data integrity methods. in other words, it has a place to store the data, a way to create and retrieve the data, and a way to make sure that the data is logically consistent.a relational database uses relations, or two-dimensional tables, to store the information needed to support a business. lets go over the basic components of a traditional relational database system and look at how a relational database is designed. once you have a solid understanding of what rows, columns, tables, and relationships are, youll be well on your way to leveraging the power of a relational database.tables, row, and columnsa table in a relational database, alternatively known as a relation, is a two-dimensional structure used to hold related information. a database consists of one or more related tables.note: dont confuse a relation with relationships. a relation is essentially a table, and a relationship is a way to correlate, join, or associate two tables.a row in a table is a collection or instance of one thing, such as one employee or one line item on an invoice. a column contains all the information of a single type, and the piece of data at the intersection of a row and a column, a field, is the smallest piece of information that can be retrieved with the databases query language. for example, a table with information about employees might have a column called last_name that contains all of the employees last names. data is retrieved from a table by filtering on both the row and the column.primary keys, datatypes, and foreign keysthe examples throughout this article will focus on the hypothetical work of scott smith, database developer and entrepreneur. he just started a new widget company and wants to implement a few of the basic business functions using the relational database to manage his human resources (hr) department.relation: a two-dimensional structure used to hold related information, also known as a table.note: most of scotts employees were hired away from one of his previous employers, some of whom have over 20 years of experience in the field. as a hiring incentive, scott has agreed to keep the new employees original hire date in the new database.row:a group of one or more data elements in a database table that describes a person, place, or thing.column:the component of a database table that contains all of the data of the same name and type across all rows.youll learn about database design in the following sections, but lets assume for the moment that the majority of the database design is completed and some tables need to be implemented. scott creates the emp table to hold the basic employee information, and it looks something like this:notice that some fields in the commission (comm) and manager (mgr) columns do not contain a value; they are blank. a relational database can enforce the rule that fields in a column may or may not be empty. in this case, it makes sense for an employee who is not in the sales department to have a blank commission field. it also makes sense for the president of the company to have a blank manager field, since that employee doesnt report to anyone.field:the smallest piece of information that can be retrieved by the database query language. a field is found at the intersection of a row and a column in a database table.on the other hand, none of the fields in the employee number (empno) column are blank. the company always wants to assign an employee number to an employee, and that number must be different for each employee. one of the features of a relational database is that it can ensure that a value is entered into this column and that it is unique. the empno column, in this case, is the primary key of the table.primary key:a column (or columns) in a table that makes the row in the table distinguishable from every other row in the same table.notice the different datatypes that are stored in the emp table: numeric values, character or alphabetic values, and date values.as you might suspect, the deptno column contains the department number for the employee. but how do you know what department name is associated with what number? scott created the dept table to hold the descriptions for the department codes in the emp table. the deptno column in the emp table contains the same values as the deptno column in the dept table. in this case, the deptno column in the emp table is considered a foreign key to the same column in the dept table.a foreign key enforces the concept of referential integrity in a relational database. the concept of referential integrity not only prevents an invalid department number from being inserted into the emp table, but it also prevents a row in the dept table from being deleted if there are employees still assigned to that department.foreign key:a column (or columns) in a table that draws its values from a primary or unique key column in another table. a foreign key assists in ensuring the data integrity of a table. referential integritya method employed by a relational database system that enforces one-to-many relationships between tables.data modelingbefore scott created the actual tables in the database, he went through a design process known as data modeling. in this process, the developer conceptualizes and documents all the tables for the database. one of the common methods for modeling a database is called era, which stands for entities, relationships, and attributes. the database designer uses an application that can maintain entities, their attributes, and their relationships. in general, an entity corresponds to a table in the database, and the attributes of the entity correspond to columns of the table.data modeling:a process of defining the entities, attributes, and relationships between the entities in preparation for creating the physical database.the data-modeling process involves defining the entities, defining the relationships between those entities, and then defining the attributes for each of the entities. once a cycle is complete, it is repeated as many times as necessary to ensure that the designer is capturing what is important enough to go into the database. lets take a closer look at each step in the data-modeling process.defining the entitiesfirst, the designer identifies all of the entities within the scope of the database application.the entities are the persons, places, or things that are important to the organization and need to be tracked in the database. entities will most likely translate neatly to database tables. for example, for the first version of scotts widget company database, he identifies four entities: employees, departments, salary grades, and bonuses. these will become the emp, dept, salgrade, and bonus tables.defining the relationships between entitiesonce the entities are defined, the designer can proceed with defining how each of the entities is related. often, the designer will pair each entity with every other entity and ask, is there a relationship between these two entities? some relationships are obvious; some are not.in the widget company database, there is most likely a relationship between emp and dept, but depending on the business rules, it is unlikely that the dept and salgrade entities are related. if the business rules were to restrict certain salary grades to certain departments, there would most likely be a new entity that defines the relationship between salary grades and departments. this entity would be known as an associative or intersection table and would contain the valid combinations of salary grades and departments.associative table:a database table that stores the valid combinations of rows from two other tables and usually enforces a business rule. an associative table resolves a many-to-many relationship.in general, there are three types of relationships in a relational database:one-to-many the most common type of relationship is one-to-many. this means that for each occurrence in a given entity, the parent entity, there may be one or more occurrences in a second entity, the child entity, to which it is related. for example, in the widget company database, the dept entity is a parent entity, and for each department, there could be one or more employees associated with that department. the relationship between dept and emp is one-to-many.one-to-one in a one-to-one relationship, a row in a table is related to only one or none of the rows in a second table. this relationship type is often used for subtyping. for example, an employee table may hold the information common to all employees, while the fulltime, parttime, and contractor tables hold information unique to full-time employees, part-time employees, and contractors, respectively. these entities would be considered subtypes of an employee and maintain a one-to-one relationship with the employee table. these relationships are not as common as one-to-many relationships, because if one entity has an occurrence for a corresponding row in another entity, in most cases, the attributes from both entities should be in a single entity.many-to-many in a many-to-many relationship, one row of a table may be related to many rows of another table, and vice versa. usually, when this relationship is implemented in the database, a third entity is defined as an intersection table to contain the associations between the two entities in the relationship. for example, in a database used for school class enrollment, the student table has a many-to-many relationship with the class tableone student may take one or more classes, and a given class may have one or more students. the intersection table student_class would contain the combinations of student and class to track which students are in which classes.once the designer has defined the entity relationships, the next step is to assign the attributes to each entity. this is physically implemented using columns, as shown here for the salgrade table as derived from the salary grade entity.after the entities, relationships, and attributes have been defined, the designer may iterate the data modeling many more times. when reviewing relationships, new entities may be discovered. for example, when discussing the widget inventory table and its relationship to a customer order, the need for a shipping restrictions table may arise. once the design process is complete, the physical database tables may be created. logical database design sessions should not involve physical implementation issues, but once the design has gone through an iteration or two, its the dbas job to bring the designers down to earth. as a result, the design may need to be revisited to balance the ideal database implementation versus the realities of budgets and schedules.共 11 页 第 11 页二、中文译文 关系数据库的结构 数据库系统结构第一章:关系数据库关系模型是任何关系数据库管理系统(rdbms)的基础。一个关系模型有二个核心组件:对象或关系的集合,作用于对象或关系上的操作,以及数据完整性规则。换句话说,关系数据库有一个存储数据的地方,一种创建和检索数据的方法,以及一种确认数据的逻辑一致性的方法。一个关系数据库使用关系或二维表来存储支持某个事物所需的信息。让我们了解一下一个传统的关系数据库系统的基本组件并目学习如何设计一个关系数据库。一旦你对于行、列、表和关联是什么有了深刻理解,你就能够充分发挥关系数据库的强大功能。表,行和列在关系数据库中,一个表(或者说一个关系)是一个用于保存相关信息的二维结构。一个数据库由一个或者多个相关联的表组成。注意:不要混淆了关系和关联。一个关系实际上是一个表,而一个关联指的是一种连接、结合或联合两个表的方式。表中的一行是一种事物的集合或实例,比如一个员工或发票上的一项。表中的一列包含了一类信息;而且行列交叉点上的数据,字段,即是能够用数据库查询语言检索到的最小片信息。举个例子来说,一个员工信息表可能有一个“名字”列,列中就包含所有员工的名字。数据是通过对行、列进行过滤而从表中检索出来的。主码、数据类型和外码本篇文章均以假设的斯科特史密斯的工厂为例,他是数据库的建立者和企业的主办人。他刚开办了一个饰品公司并目想要使用关系数据库的几项基本功能来管理人力资源部门。关系:用来保存相关信息的一个二维结构(也就是表)。注意:大多数斯科特的雇员都是雇自过去的从业者,他们中有些人在这个领域己经有20年的经验了。出于雇用的目的,斯科特同意在新数据库中维持新进员工最初的雇佣日期。行:在一个数据库表中的一组单数据或多数据元素,用于描述一个人、地方或事物。列:列是数据库表的组件,它包含所有行中同名和同类型的所有数据。你会在下面章节学到如何设计数据库,现在让我们假设数据库大部分己经设计完成并且有一些表需要被执行。斯科特创建了emp表来保存基本的员工信息,就像这样:你可能注意到佣金列和管理人列中有一些单元格中没有值;它们是空值。一个关系数据库能够规定列中的一个单元格是否为空。如此,可以明确那些非销售部的员工佣金单元为空。同样也明确了公司董事长的管理人单元为空,因为这个员工不需要向任何人汇报工作。单元格:是数据库查询语言所能够检索到的最小片信息。一个单元格就是一个数据库表的行和列交叉形成的。另一方面,没有哪个员工的员工编号单元为空。公司总是希望为每个员工分配一个员工号,并目这个号码必须是每个员工都不同的。关系数据库的一个特性能够确定某列的键入值必须为单值。如此,员工编号列便是这个表的主码。主码:主码即是表中的一列(或多列),使每一行能够区别于同表中的其他行。留意一下emp表中存储的不同数据类型:数值型,字符型或字母型,以及日期型。如你所想,部门成员列保存的是员工所在部门的编号。但是你如何知道哪个部门名称对应哪个部门编号呢?斯科特建立了dept表来具体描述emp表中提到的部门编号的情况。emp表中的部门编号列同dept表中的部门编号列有着相同的值。既然如此,emp表中的部门编号列便被看作是与dept表中相同列对应的外码。外码加强了关系数据库中参考完整性的概念。参考完整性的概念不只可以阻止无效的部门编号被插入emp表中,而且在某部门仍有员工的情况下,可以防止dept表中该部门的信息被删除。外码:表中的一列(或多列),它的值来自于其他表的主码列或单值列。一个外码有助于确定表中数据的完整性。参考完整性:是关系数据库用来加强表间一对多关联的一种方式。数据建模在斯科特于数据库中创建真实表之前,他要经过一个称作数据建模的过程。在这个过程中,数据库创建者定义和填写数据库中所有表。有一种为数据库建模的方式叫作era,它可以表示出实体、实体间的关联和实体的属性。数据库设计者使用一个能够支持实体、实体属性和实体间关联的应用程序。通常,一个实体对应数据库中的一个表,而实体的属性对应于表中的列。数据建模:一个定义实体、实体属性和实体间关联的过程,从而为建
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年终止不定期劳动合同的规定与操作流程
- 项目立项案例题目及答案
- 叉车考试科目一的题目及答案
- 物体打击试题及答案
- 2024译林版八年级英语上册Unit 1 课时4 Grammar 分层作业(含答案)
- 营销策划岗位知识培训课件
- 2025年高考化学试题分类汇编:化学实验基础(解析版)
- 物流考试试题及答案2025
- 2025型钢租赁合同
- 物流的试题及答案
- 全套教学课件《公共艺术(音乐)》
- 3.1《太阳系大家庭》课件
- 高中数学《基于问题链的数学教学探索》课件
- 小学科学二年级上册开学第一课课件
- (卓越绩效)质量奖申报材料
- 同创伟业投资分析报告(附358家被投企业介绍)
- 数学-四年级(上册)-人教版-《亿以上数的认识及读法》教学课件
- 政治经济学ppt课件汇总(完整版)
- 消费者行为学全书电子教案完整版课件
- 互联网保险概述课件
- 怎样做一名合格的高校中层领导干部( 54页)
评论
0/150
提交评论