计算机专业英语Unit06SectionADatabaseOverview.ppt

上传人:za****8 文档编号:6232894 上传时间:2020-02-20 格式:PPT 页数:49 大小:457.50KB
返回 下载 相关 举报
计算机专业英语Unit06SectionADatabaseOverview.ppt_第1页
第1页 / 共49页
计算机专业英语Unit06SectionADatabaseOverview.ppt_第2页
第2页 / 共49页
计算机专业英语Unit06SectionADatabaseOverview.ppt_第3页
第3页 / 共49页
点击查看更多>>
资源描述
Unit6DatabaseSectionADatabaseOverview 2 45 I Introduction Datastoragetraditionallyusedindividual unrelatedfiles sometimescalledflatfiles Inthepast eachapplicationprograminanorganizationuseditsownfile Inauniversity forexample eachdepartmentmighthaveitsownsetoffiles therecordofficekeptafileaboutthestudentinformationandtheirgrades thefinancialaidofficekeptitsownfileaboutstudentsthatneededfinancialaidtocontinuetheireducation 一 引言数据存储传统上是使用单独的没有联系的文件 这些文件有时称为平面文件 在过去 一个机构中的每个应用程序都使用自己的文件 例如 在一个大学中 每个部门都可能有其自己的文件集 档案办公室保存着关于学生信息和学生成绩的文件 经济资助办公室保存着其自己的关于需要经济资助以继续学业的学生的文件 3 45 I Introduction theschedulingofficekeptthenamesoftheprofessorsandthecoursestheywereteaching thepayrolldepartmentkeptitsownfileaboutthewholestaff includingprofessors andsoon Today however alloftheseflatfilescanbecombinedinasingleentity thedatabaseforthewholeuniversity 调度办公室保存着教授的姓名和他们所教的课程 工薪发放部门保存着其自己的关于全体教职员工 包括教授 的文件 等等 然而 所有这些平面文件今天都可结合成一个实体 供整个大学使用的数据库 4 45 I Introduction Althoughitisdifficulttogiveauniversallyagreeddefinitionofadatabase weusethefollowingcommondefinition adatabaseisacollectionofrelated logically coherentdatausedbytheapplicationprogramsinanorganization 虽然难以给出一个普遍接受的数据库定义 但我们使用下面常见的定义 一个数据库是被一个机构内的应用程序所使用的具有逻辑相干性的相关数据的集合 adj 粘在一起的 一致的 连贯的acoherentessay 一篇条理分明的文章 5 45 DatabaseManagementSystems Adatabasemanagementsystem DBMS defines creates andmaintainsadatabase TheDBMSalsoallowscontrolledaccesstodatainthedatabase ADBMSisacombinationoffivecomponents hardware software data users andprocedures 数据库管理系统定义 创建和维护数据库 数据库管理系统也允许对数据库中的数据进行受控的访问 一个数据库管理系统由5个组成部分构成 硬件 软件 数据 用户和规程 6 45 DatabaseManagementSystems 1 HardwareThehardwareisthephysicalcomputersystemthatallowsaccesstodata Forexample theterminals harddisk maincomputerandworkstationsareconsideredpartofthehardwareinaDBMS 1 硬件硬件是指允许访问数据的计算机物理系统 例如 终端 硬盘 主机和工作站被认为是数据库管理系统的硬件组成部分 7 45 DatabaseManagementSystems 2 SoftwareThesoftwareistheactualprogramthatallowsuserstoaccess maintain andupdatedata Inaddition thesoftwarecontrolswhichusercanaccesswhichpartsofthedatainthedatabase 2 软件软件是指允许用户访问 维护和更新数据的实际程序 另外 软件还控制着哪个用户可以对数据库中的哪部分数据进行访问 8 45 DatabaseManagementSystems 3 DataThedatainadatabaseisstoredphysicallyonthestoragedevice Inadatabase dataisaseparateentityfromthesoftwarethataccessesit Thisseparationallowsanorganizationtochangethesoftwarewithouthavingtochangethephysicaldataorthewayinwhichitisstored 3 数据数据库中的数据存储在物理存储设备上 在一个数据库中 数据是独立于对其进行访问的软件的一个实体 这种独立使一个机构可以在不必更改物理数据及其存储方式的情况下更改软件 9 45 DatabaseManagementSystems IfanorganizationdecidestouseaDBMS thenalltheinformationneededbytheorganizationshouldbekepttogetherasoneentity tobeaccessiblebythesoftwareintheDBMS 如果一个机构决定使用一个数据库管理系统 那么该机构所需要的所有信息都应作为一个实体保存在一起 可由数据库管理系统中的软件访问 10 45 DatabaseManagementSystems 4 UsersThetermuserinaDBMShasabroadmeaning Wecandivideusersintotwocategories endusersandapplicationprograms Endusersarethosehumanswhocanaccessthedatabasedirectlytogetinformation Therearetwotypesofendusersdatabaseadministrators DBAs andnormalusers 4 用户在数据库管理系统中 用户这个术语有着广泛的定义 我们可以将用户分为两类 最终用户和应用程序 最终用户是指可直接访问数据库以获取信息的人 最终用户又分为两类 数据库管理员和普通用户 adj 宽的 阔的 广泛的abroadriver broadshoulders 宽广的大河 宽阔的双肩abroad adv 往国外 到处 海外goabroad出国 11 45 DatabaseManagementSystems DatabaseadministratorshavethemaximumlevelofprivilegesandcancontrolotherusersandtheiraccesstotheDBMS grantsomeoftheirprivilegestosomebodyelse butretaintheabilitytorevokethematanytime Anormaluser ontheotherhand canonlyusepartofthedatabaseandhaslimitedaccess 数据库管理员拥有最高程度的特权 可以控制其他用户及其对数据库管理系统的访问 可以将其某些特权授予其他人并保留随时收回这些特权的能力 另一方面 普通用户只能使用数据库的一部分 只能进行有限的访问 vt 同意 准予 承认 某事为真 n 补助金 助学金 赠款 津贴Thegovernmentgaveusagranttobuildanotherclassroom 政府给了我们一笔补助 用来盖另外一间教室 vt 撤回 废除 宣告无效Herlicensewasrevoked 她的执照被吊销 12 45 DatabaseManagementSystems Theotherusersofdatainadatabaseareapplicationprograms Applicationsneedtoaccessandprocessdata Forexample apayrollapplicationprogramneedstoaccesspartofthedatainadatabasetocreatepaychecksattheendofthemonth 数据库中数据的其他用户就是应用程序 应用程序需要访问和处理数据 例如 工薪发放应用程序需要在月底访问数据库中的部分数据 来开支付工薪的支票 13 45 DatabaseManagementSystems 5 ProceduresThelastcomponentofaDBMSisasetofproceduresorrulesthatshouldbeclearlydefinedandfollowedbytheusersofthedatabase 5 规程数据库管理系统的最后一个组成部分就是应该明确定义并为数据库用户所遵循的一套规程或规则 14 45 DatabaseArchitecture TheAmericanNationalStandardsInstituteStandardsPlanningandRequirementsCommittee ANSI SPARC hasestablishedathree levelarchitectureforaDBMS internal conceptual andexternal Figure6A 1 三 数据库体系结构美国国家标准协会标准计划与需求委员会 ANSI SPARC 为数据库管理系统确立了一个包含3个层次的体系结构 内层 概念层和外层 15 45 Hardware Figure6A 1 DatabaseArchitecture UserView UserView UserView ExternalView ConceptualView InternalView 16 45 DatabaseArchitecture 1 InternalLevelTheinternalleveldetermineswheredataisactuallystoredonthestoragedevices Thisleveldealswithlowlevelaccessmethodsandhowbytesaretransferredtoandfromstoragedevices Inotherwords theinternallevelinteractsdirectlywiththehardware 1 内层内层决定数据在存储设备上的实际存储位置 该层涉及低级访问方法 以及字节如何传向和传自存储设备 换句话说 内层直接与硬件交互 17 45 DatabaseArchitecture 2 ConceptualLevelTheconceptualleveldefinesthelogicalviewofthedata Thedatamodelisdefinedonthislevel andthemainfunctionsoftheDBMS suchasqueries arealsoonthislevel TheDBMSchangestheinternalviewofdatatotheexternalviewthatusersneedtosee Theconceptuallevelisanintermediaryandfreesusersfromdealingwiththeinternallevel 2 概念层概念层定义数据的逻辑视图 数据模型在该层定义 数据库管理系统的主要功能 如查询 也在该层 数据库管理系统把数据的内部视图转化为用户需要看到的外部视图 概念层是中介层 它使得用户不必与内层打交道 18 45 DatabaseArchitecture 3 ExternalLevelTheexternallevelinteractsdirectlywiththeuser endusersorapplicationprograms Itchangesthedatacomingfromtheconceptualleveltoaformatandviewthatisfamiliartotheusers 3 外层外层直接与用户 最终用户或应用程序 交互 它将来自概念层的数据转化为用户所熟悉的格式和视图 19 45 IV DatabaseModels Adatabasemodeldefinesthelogicaldesignofdata Themodelalsodescribestherelationshipsbetweendifferentpartsofthedata Inthehistoryofdatabasedesign threemodelshavebeeninuse thehierarchicalmodel thenetworkmodel andtherelationalmodel 数据库模型定义数据的逻辑设计 它也描述数据的不同部分之间的关系 在数据库设计史上 使用过3种数据库模型 层次模型 网络模型和关系模型 20 45 IV DatabaseModels 1 HierarchicalDatabaseModelInthehierarchicalmodel dataisorganizedasaninvertedtree eachentityhasonlyoneparentbutcanhaveseveralchildren Atthetopofthehierarchy thereisoneentity whichiscalledtheroot Figure6A 2showsalogicalviewofanexampleofthehierarchicalmodel Thehierarchicalmodelisnowobsolete 1 层次数据库模型在层次模型中 数据被组织成一棵倒置的树 每个实体只有一个父 但可有数个子 在分层结构的顶部 有一个实体 称为根 图6A 2给出了一个层次模型例子的逻辑视图 层次模型现在已经过时 invert vt 使颠倒 使转化convert vt 使转变 转换 使 改变信仰revert vi 与to连用 恢复原状 回复 回到 原来话题 adj 荒废的 陈旧的anobsoleteword已废的词 21 45 Figure6A 2 AnExampleoftheHierarchicalModelRepresentingaUniversity No Name No Name No Name ID Name Unit Unit Department Courses Students Professors 22 45 IV DatabaseModels 2 NetworkDatabaseModelInthenetworkmodel theentitiesareorganizedinagraph inwhichsomeentitiescanbeaccessedthroughseveralpaths Figure6A 3 Thereisnohierarchy Thismodelisnowalsoobsolete 2 网络数据库模型在网络模型中 实体以图的形式来组织 图中的有些实体可通过多条路径访问 网络模型没有分层结构 这种模型现在也已经过时 23 45 Figure6A 3 AnExampleoftheNetworkModelRepresentingaUniversity No Name No Name No Name ID Name Unit Unit Department Courses Students Professors 24 45 IV DatabaseModels 3 RelationalDatabaseModelIntherelationalmodel dataisorganizedintwo dimensionaltablescalledrelations Thereisnohierarchicalornetworkstructureimposedonthedata Thetablesorrelationsare however relatedtoeachother Figure6A 4 3 关系数据库模型在关系模型中 数据被组织成称为关系的二维表 关系模型没有分层或网络结构强加于数据 然而 表或关系是相互关联的 25 45 Figure6A 4 AnExampleoftheRelationalModelRepresentingaUniversity Department Courses Students Professors 26 45 IV DatabaseModels Therelationaldatabasemanagementsystem RDBMS organizesthedatasothatitsexternalviewisasetofrelationsortables Thisdoesnotmeanthatdataisstoredastables thephysicalstorageofthedataisindependentofthewayinwhichthedataislogicallyorganized 关系数据库管理系统组织数据 使其外部视图呈现为关系或表的集合 这并不意味着数据以表的形式存储 数据的物理存储与数据的逻辑组织方式毫无关系 27 45 IV DatabaseModels Figure6A 5showsanexampleofarelation ArelationinanRDBMShasthefollowingfeatures Name Eachrelationinarelationaldatabaseshouldhaveanamethatisuniqueamongotherrelations 图6A 5给出了一个关系的例子 关系数据库管理系统中的关系具有以下特征 名称 关系数据库中的每个关系都应具有一个名称 而这个名称在所有关系中是独一无二的 28 45 Figure6A 5 AnExampleofaRelation Attributes Tuples Courses 29 45 IV DatabaseModels Attributes Eachcolumninarelationiscalledanattribute TheattributesarethecolumnheadingsinthetableinFigure6A 5 Eachattributegivesmeaningtothedatastoredunderit Eachcolumninthetablemusthaveanamethatisuniqueinthescoreoftherelation Thetotalnumberofattributesforarelationiscalledthedegreeoftherelation 属性 关系中的每一列都称为一个属性 在图6A 5的表中 属性是列的标题 每个属性赋予存储在其下面的数据以意义 表中的每一列都必须具有一个在关系的范围内独一无二的名称 一个关系的属性总数称为该关系的度 30 45 IV DatabaseModels Forexample inFigure6A 5 therelationhasadegreeof3 Notethattheattributenamesarenotstoredinthedatabase theconceptuallevelusestheattributestogivemeaningtoeachcolumn 例如 在图6A 5中 关系的度为3 注意属性名并不存储在数据库中 概念层使用属性给每一列赋予一定的意义 31 45 IV DatabaseModels Tuples Eachrowinarelationiscalledatuple Atupledefinesacollectionofattributevalues Thetotalnumberofrowsinarelationiscalledthecardinalityoftherelation Notethatthecardinalityofarelationchangeswhentuplesareaddedofdeleted Thismakesthedatabasedynamic 元组 关系中的每一行称为一个元组 元组定义一组属性值 一个关系中的总行数称为该关系的基数 注意一个关系的基数随着元组的增加或删除而改变 这使数据库具有了动态性 32 45 IV DatabaseModels Therelationalmodelisoneofthecommonmodelsinusetoday Theothertwocommonmodelsthatarederivedfromtherelationalmodelarethedistributedmodelandtheobject orientedmodel 关系模型是今天使用的常见模型之一 源自关系模型的另外两种常见模型是分布式模型和面向对象模型 33 45 IV DatabaseModels 4 DistributedDatabaseModelThedistributeddatabasemodelisnotanewmodel butisbasedontherelationalmodel However thedataisstoredonseveralcomputersthatcommunicatethroughtheInternetoraprivatewideareanetwork 4 分布式数据库模型分布式数据库模型并非一种新模型 而是基于关系模型的 但是 数据存储在通过因特网或专用广域网通信的数台计算机上 34 45 IV DatabaseModels Eachcomputer orsite maintainseitherpartofthedatabaseorthewholedatabase Inotherwords dataiseitherfragmented witheachfragmentstoredatonesite ordataisreplicatedateachsite 每台计算机 或站点 保持数据库的一部分或整个数据库 换句话说 数据或者是分段存储的 每个站点存储一段 或者被每个站点复制一份 35 45 IV DatabaseModels Inafragmenteddistributeddatabase dataislocalized locallyuseddataisstoredatthecorrespondingsite However thisdoesnotmeanthatasitecannotaccessdatastoredatanothersite butaccessismostlylocal butoccasionallyglobal Althougheachsitehascompletecontroloveritslocaldata thereisglobalcontrolthroughtheinternetorawideareanetwork 在分段型分布式数据库中 数据是本地化的 本地使用的数据存储在相应的站点上 然而 这并不意味着一个站点不能访问存储在另一个站点上的数据 但访问大多是本地性的 偶尔是全局性的 虽然每个站点对其本地数据具有完全的控制 但也存在通过因特网或广域网的全局控制 36 45 IV DatabaseModels Forexample apharmaceuticalcompanymayhavemultiplesitesinmanycountries Eachsitehasadatabasewithinformationaboutitsownemployees butacentralpersonneldepartmentcouldhavecontrolofallthedatabases 例如 一家制药公司可能在许多国家拥有多个站点 每个站点有一个数据库 存储着自己雇员的信息 但是 中心人事部门可以控制所有的数据库 37 45 IV DatabaseModels Inareplicateddistributeddatabase eachsiteholdsallexactreplicaofanothersite Anymodificationtodatastoredinonesiteisrepeatedexactlyateverysite Thereasonforhavingsuchadatabaseissecurity Ifthesystematonesitefails usersatthesitecanaccessdataatanothersite 在复制型分布式数据库中 每个站点都有其他站点的一个完全副本 对一个站点所存储的数据进行的任何修改 都要在其他每个站点上精确地重复进行 拥有这种数据库是为了安全 如果一个站点上的系统发生故障 该站点的用户可以访问另一个站点上的数据 38 45 IV DatabaseModels 5 Object OrientedDatabaseModelTherelationaldatabasehasaspecificviewofdatathatisbasedonthenatureofthedatabase stuplesandattributes Thesmallestunitofdatainarelationaldatabaseistheintersectionofatupleandanattribute However someapplicationsneedtolookatdataasotherforms forexample toseedataasastructure suchasarecordcomposedoffields 5 面向对象数据库模型关系数据库具有一个特定的数据视图 该视图基于数据库元组与属性的性质 关系数据库中最小的数据单位是一个元组与一个属性的交集 然而 有些应用程序需要将数据视为其他形式 如看作一种结构 像由字段构成的记录 39 45 IV DatabaseModels Anobject orienteddatabasetriestokeeptheadvantagesoftherelationalmodelandatthesametimeallowsapplicationstoaccessstructureddata InanObject Orienteddatabase objectsandtheirrelationsaredefined Inaddition eachobjectcanhaveattributesthatcanbeexpressedasfields 面向对象数据库试图保留关系模型的优点 同时允许应用程序访问结构化数据 在面向对象数据库中 对象及其之间的关系得到定义 此外 每个对象可以具有可表示为字段的属性 40 45 IV DatabaseModels Forexample inanorganization onecoulddefineobjecttypesforemployee department andcustomer Theemployeeclasscoulddefinetheattributesofanemployeeobject firstname lastname socialsecuritynumber salary andsoon andhowtheycanbeaccessed 例如 在一个机构中 可以为雇员 部门和客户定义对象类型 雇员类可以定义一个雇员对象的属性 名 姓 社会保险号码 薪水等等 以及可以如何访问它们 41 45 IV DatabaseModels Thedepartmentobjectcoulddefinetheattributesofthedepartmentandhowtheycanbeaccessed Inaddition thedatabasecouldcreatearelationbetweenemployeeobjectandadepartmentobjecttodenotethattheemployeeworksinthatdepartment 部门对象可以定义部门的属性 以及可以如何访问它们 此外 数据库还可以在一个雇员对象与一个部门对象之间创建一种关系 以表示该雇员在该部门工作 42 45 DatabaseDesign Thedesignofanydatabaseisalengthyandinvolvedtaskthatcanonlybedonethroughastep by stepprocess Thefirststepnormallyinvolvesalotofinterviewingofpotentialusersofthedatabasetocollecttheinformationneededtobestoredandtheaccessrequirementofeachdepartment 任何数据库的设计都是一项冗长 复杂的任务 只能通过一个逐步的过程来完成 第一步通常涉及对数据库潜在用户的大量访谈 以收集需要存储的信息和每个部门的访问需求 43 45 DatabaseDesign ThesecondstepistobuildanEntity RelationshipModel ERM thatdefinestheentitiesforwhichsomeinformationmustbemaintained theattributesoftheseentities andtherelationshipbetweentheseentities 第二步是建立一个实体关系模型 该模型定义必须为之保存一些信息的实体 这些实体的属性以及这些实体之间的关系 44 45 DatabaseDesign Thenextstepindesignisbasedonthetypeofdatabasetobeused Inarelationaldatabase thenextstepistobuildrelationsbasedontheERMandnormalizetherelations Normalizationistheprocessbywhichagivensetofrelationsaretransformedtoanewsetofrelationswithamoresolidstructure 设计的下一步基于所要使用的数据库的类型 在关系数据库中 下一步是建立基于实体关系模型的关系 并规范化这些关系 规范化是一个过程 通过该过程一组特定的关系转化成一组具有更坚固结构的新关系 45 45 DatabaseDesign Normalizationisneededtoallowanyrelationinthedatabasetoberepresented toallowalanguagelikeSQLtousepowerfulretrievaloperationscomposedofatomicoperations toremoveanomaliesininsertion deletion andupdating andtoreducetheneedforrestructuringthedatabaseasnewdatatypesareadded 为了达到以下目的 需要规范化 允许数据库中的任何关系得到表示 允许像SQL 结构化查询语言 这样的语言使用由原子操作组成的功能强大的检索操作 消除插入 删除和更新操作中的异常 以及减少添加新的数据类型时重构数据库的必要性 46 45 第六章课后习题参考答案 I Fillintheblankwiththeinformationgiveninthetext FlatDataApplication administratorsConceptualTablesFragmented replicatedStructuredEntity relationship attributes 47 45 第六章课后习题参考答案 II TranslatethefollowingtermsorphrasesfromEnglishtoChineseandviceversa Enduser最终用户Atomicoperation原子操作Databaseadministrator数据库管理员Relationaldatabasemodel关系型数据库模型Localdata本地数据Object orienteddatabase面向对象数据库DatabasemanagementsystemDBMS数据库管理系统Entityrelationshipmodel实体关系模型Distributeddatabase分布式数据库Flatfile平面文件二维表two dimensionaltable数据属性dataattribute数据库对象databaseobject存储设备storagedevice数据类型datatype数据插入与删除datainsertionanddeletion层次数据库模型hierarchicaldatabasemodel数据库体系结构databasearchitecture关系数据库管理系统relationaldatabasemanagementsystem全局控制总线globalcontrolbus 48 45 第六章课后习题参考答案 III Fillineachoftheblankswithoneofthewordsgiveninthefollowinglist makingchangesifnecessary AccessTextDevelopedUseAvailableCentersOnlineLinkExperimentalImportantEveryDatabasesLimitedNonprofitPublicEquipment 49 45 第六章课后习题参考答案 IV TranslatethefollowingpassagefromEnglishintoChinese 在关系型数据库中 表的行表示记录 关于不同项的信息集 列表示字段 一个记录的特定属性 在进行搜索时 关系数据库将一个表中的一个字段的信息与另一个表中一个相应字段的信息进行匹配 以生成将来自这两个表的所要求数据结合起来的另一个表 例如 如果一个表包含employee id last name first name和hire date字段 另一个表包括dept employ id和salary字段 关系数据库可以匹配这两个表中的employee id字段 已找到特定的信息 如所有挣到一定薪水的员工的姓名和所有在某个日期之后受雇的雇员所属的部门 换言之 关系数据库使用两个表中的匹配值 将一个表中的信息与另一个表中的信息联系起来 微型计算机数据库一般是关系型数据库
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 课件教案


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!