版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
#外文資料原文DatabaseSystemsIntroductiontoDatabaseSystemToday,morethanatanyprevioustime,thesuccessofanorganizationdependsonitsabilitytoacquireaccurateandtimelydataaboutitsoperation,tomanagethisdataeffectively,andtouseittoanalyzeandguideitsactivities.Phrasessuchastheinformationsuperhighwayhavebecomeubiquitous,andinformationprocessingisarapidlygrowingmultibilliondollarindustry。Theamountofinformationavailabletousisliterallyexploding,andthevalueofdataasanorganizationalassetisbeingwidelyrecognized。Thisparadoxdrivestheneedforincreasinglypowerfulandflexibledatamanagementsystems。Adatabaseisacollectionofdata,typicallydescribingtheactivitiesofoneormorerelatedorganizations.Forexample,auniversitydatabasemightcontaininformationaboutthefollowing.?Entitiessuchasstudents,faculty,courses,andclassrooms。?Relationshipsbetweenentities,suchasstudents'enrollmentincourses,facultyteachingcourses,andtheuseofroomsforcourses.Adatabasemanagementsystem,orDBMS,issoftwaredesignedtoassistinmaintainingandutilizinglargecollectionsofdata,andtheneedforsuchsystems,aswellastheiruse,isgrowingrapidly。ThealternativetousingaDBMSistouseadhocapproachesthatdonotcarryoverfromoneapplicationtoanother,forexample,tostorethedatainfilesandwriteapplication-specificcodetomanageit。Theareaofdatabasemanagementsystemsisamicrocosmofcomputerscienceingeneral.Theissuesaddressedandthetechniquesusedspanawidespectrum,includinglanguages,object-orientationandotherprogrammingparadigms,compilation,operatingsystemsconcurrentprogramming,datastructures,algorithms,theory,parallelanddistributedsystems,userinterfaces,expertsystemsandartificialintelligence,statisticaltechniques,anddynamicprogramming.Databasemanagementcontinuestogainimportanceasmoreandmoredataisbroughton-line,andmadeevermoreaccessiblethroughcomputernetworking。Todaythefieldisbeingdrivenbyexcitingvisionssuchasmultimediadatabases,interactivevideo,digitallibraries,ahostofscientificprojectssuchasthehumangenomemappingeffortandNASA'sEarthObservationSystemproject,andthedesireofcompaniestoconsolidatetheirdecision-makingprocessesandminetheirdatarepositoriesforusefulinformationabouttheirbusiness.Commercially,databasemanagementsystemsrepresentoneofthelargestandmostvigorousmarketsegments.Thusthestudyofdatabasesystemscouldprovetoberichlyrewardinginmorewaysthanone.DatabaseconsistsAdatabaseconsistsofafileorasetoffiles。Theinformationinthesefilesmaybebrokendownintorecords,eachofwhichconsistsofoneormorefields。Fieldsarethebasicunitsofdatastorage,andeachfieldtypicallycontainsinformationpertainingtooneaspectorattributeoftheentitydescribedbythedatabase.Usingkeywordsandvarioussortingcommands,userscanrapidlysearch,rearrange,group,andselectthefieldsinmanyrecordstoretrieveorcreatereportsonparticularaggregatesofdata。Databaserecordsandfilesmustbeorganizedtoallowretrievaloftheinformation。Earlysystemswerearrangedsequentially(i。e。,alphabetically,numerically,orchronologically);thedevelopmentofdirect-accessstoragedevicesmadepossiblerandomaccesstodataviaindexes。Queriesarethemainwayusersretrievedatabaseinformation。Typically,theuserprovidesastringofcharacters,andthecomputersearchesthedatabaseforacorrespondingsequenceandprovidesthesourcematerialsinwhichthosecharactersappear。Ausercanrequest,forexample,allrecordsinwhichthecontentofthefieldforaperson'slastnameisthewordSmith。Inflatdatabases,recordsareorganizedaccordingtoasimplelistofentities;manysimpledatabasesforpersonalcomputersareflatinstructure。Therecordsinhierarchicaldatabasesareorganizedinatreelikestructure,witheachlevelofrecordsbranchingoffintoasetofsmallercategories。Unlikehierarchicaldatabases,whichprovidesinglelinksbetweensetsofrecordsatdifferentlevels,networkdatabasescreatemultiplelinkagesbetweensetsbyplacinglinks,orpointers,toonesetofrecordsinanother;thespeedandversatilityofnetworkdatabaseshaveledtotheirwideuseinbusiness.Relationaldatabasesareusedwhereassociationsamongfilesorrecordscannotbeexpressedbylinks;asimpleflatlistbecomesonetable,or“relation”,andmultiplerelationscanbemathematicallyassociatedtoyielddesiredinformation。Object-orienteddatabasesstoreandmanipulatemorecomplexdatastructures,called“objects”,whichareorganizedintohierarchicalclassesthatmayinheritpropertiesfromclasseshigherinthechain;thisdatabasestructureisthemostflexibleandadaptable。StructureoftheRelationaldatabaseTherelationalmodelisthebasisforanyrelationaldatabasemanagementsystem(RDBMS).Arelationalmodelhasthreecorecomponents:acollectionofobjectsorrelations,operatorsthatactontheobjectsorrelations,anddataintegritymethods.Inotherwords,ithasaplacetostorethedata,awaytocreateandretrievethedata,andawaytomakesurethatthedataislogicallyconsistent。Arelationaldatabaseusesrelations,ortwo-dimensionaltables,tostoretheinformationneededtosupportabusiness.3。I.Tables,Row,andColumnsAtableinarelationaldatabase,alternativelyknownasarelation,isatwo-dimensionalstructureusedtoholdrelatedinformation。Adatabaseconsistsofoneormorerelatedtables.Note:Don'tconfusearelationwithrelationships。Arelationisessentiallyatable,andarelationshipisawaytocorrelate,join,orassociatetwotables。Arowinatableisacollectionorinstanceofonething,suchasoneemployeeoronelineitemonaninvoice。Acolumncontainsalltheinformationofasingletype,andthepieceofdataattheintersectionofarowandacolumn,afield,isthesmallestpieceofinformationthatcanberetrievedwiththedatabase'squerylanguage。Forexample,atablewithinformationaboutemployeesmighthaveacolumncalledLAST_NAMEthatcontainsalloftheemployees'lastnames。Dataisretrievedfromatablebyfilteringonboththerowandthecolumn.3.2.PrimaryKeys,Datatypes,andForeignKeysRelation:Atwo-dimensionalstructureusedtoholdrelatedinformation,alsoknownasatable。Row:Agroupofoneormoredataelementsinadatabasetablethatdescribesaperson,place,orthing。Column:Thecomponentofadatabasetablethatcontainsallofthedataofthesamenameandtypeacrossallrows。PrimaryKey:Acolumn(orcolumns)inatablethatmakestherowinthetabledistinguishablefromeveryotherrowinthesametable。Datatypes:numericvalues,characteroralphabeticvalues,anddatevalues。Aforeignkeyenforcestheconceptofreferentialintegrityinarelationaldatabase。ForeignKey:Acolumn(orcolumns)inatablethatdrawsitsvaluesfromaprimaryoruniquekeycolumninanothertable.Aforeignkeyassistsinensuringthedataintegrityofatable。ReferentialIntegrityAmethodemployedbyarelationaldatabasesystemthatenforcesone—to—manyrelationshipsbetweentables.3。3。DataModelingInthisprocess,thedeveloperconceptualizesanddocumentsallthetablesforthedatabase。OneofthecommonmethodsformodelingadatabaseiscalledERA,whichstandsforentities,relationships,andattributes。Thedatabasedesignerusesanapplicationthatcanmaintainentities,theirattributes,andtheirrelationships。Ingeneral,anentitycorrespondstoatableinthedatabase,andtheattributesoftheentitycorrespondtocolumnsofthetable。DataModeling:Aprocessofdefiningtheentities,attributes,andrelationshipsbetweentheentitiesinpreparationforcreatingthephysicaldatabase。Thedata—modelingprocessinvolvesdefiningtheentities,definingtherelationshipsbetweenthoseentities,andthendefiningtheattributesforeachoftheentities。Onceacycleiscomplete,itisrepeatedasmanytimesasnecessarytoensurethatthedesigneriscapturingwhatisimportantenoughtogointothedatabase。Let'stakeacloserlookateachstepinthedata-modelingprocess.3。4。DefiningtheEntitiesFirst,thedesigneridentifiesalloftheentitieswithinthescopeofthedatabaseapplication.Theentitiesarethepersons,places,orthingsthatareimportanttotheorganizationandneedtobetrackedinthedatabase.Entitieswillmostlikelytranslateneatlytodatabasetables.3。5。DefiningtheRelationshipsBetweenEntitiesOncetheentitiesaredefined,thedesignercanproceedwithdefininghoweachoftheentitiesisrelated。Often,thedesignerwillpaireachentitywitheveryotherentityandask,"Istherearelationshipbetweenthesetwoentities?”Somerelationshipsareobvious;somearenot.Inthewidgetcompanydatabase,thereismostlikelyarelationshipbetweenEMPandDEPT,butdependingonthebusinessrules,itisunlikelythattheDEPTandSALGRADEentitiesarerelated。Ifthebusinessrulesweretorestrictcertainsalarygradestocertaindepartments,therewouldmostlikelybeanewentitythatdefinestherelationshipbetweensalarygradesanddepartments.Thisentitywouldbeknownasanassociativeorintersectiontableandwouldcontainthevalidcombinationsofsalarygradesanddepartments。AssociativeTable:Adatabasetablethatstoresthevalidcombinationsofrowsfromtwoothertablesandusuallyenforcesabusinessrule。Anassociativetableresolvesamany-to—manyrelationship.Ingeneral,therearethreetypesofrelationshipsinarelationaldatabase:One—to-manythemostcommontypeofrelationshipisone—to-many。Thismeansthatforeachoccurrenceinagivenentity,theparententity,theremaybeoneormoreoccurrencesinasecondentity,thechildentity,towhichitisrelated.Forexample,inthewidgetcompanydatabase,theDEPTentityisaparententity,andforeachdepartment,therecouldbeoneormoreemployeesassociatedwiththatdepartment。TherelationshipbetweenDEPTandEMPisone—to-many。One—to-oneInaone—to—onerelationship,arowinatableisrelatedtoonlyoneornoneoftherowsinasecondtable。Thisrelationshiptypeisoftenusedforsubtyping.Forexample,anEMPLOYEEtablemayholdtheinformationcommontoallemployees,whiletheFULLTIME,PARTTIME,andCONTRACTORtablesholdinformationuniquetofull—timeemployees,part—timeemployees,andcontractors,respectively.TheseentitieswouldbeconsideredsubtypesofanEMPLOYEEandmaintainaone—to-onerelationshipwiththeEMPLOYEEtable。Theserelationshipsarenotascommonasone-to-manyrelationships,becauseifoneentityhasanoccurrenceforacorrespondingrowinanotherentity,inmostcases,theattributesfrombothentitiesshouldbeinasingleentity.Many—to-manyinamany-to—manyrelationship,onerowofatablemayberelatedtomanyrowsofanothertable,andviceversa。Usually,whenthisrelationshipisimplementedinthedatabase,athirdentityisdefinedasanintersectiontabletocontaintheassociationsbetweenthetwoentitiesintherelationship。Forexample,inadatabaseusedforschoolclassenrollment,theSTUDENTtablehasamany—to—manyrelationshipwiththeCLASStable—onestudentmaytakeoneormoreclasses,andagivenclassmayhaveoneormorestudents.TheintersectiontableSTUDENT_CLASSwouldcontainthecombinationsofSTUDENTandCLASStotrackwhichstudentsareinwhichclasses。4.DBMSIntroductionThetermdatabaseisoftentodescribeacollect:onofrelatedfilesthatisorganizedintoaninte—.7atedstructurethatprovidesdifferentpeoplevariancestothesamedata.Forexample,thedepartmentmotorvehicleshasadatabaseofalltheinformal:ondriver'slicensesinallcountiesandcitiesinstate.Someoftheinformationinthefiles(e.g.pastcriminalrecord,convictions,andthelike)maybemadeavailabletopolicedepartments,otherinformation(e。g。abalancedueonaspeedingticket)maybemadeavailabletolicensingbureaus,andstillotherinformation(e。g。numberandtypeofconvictions)maygotoinsurancecompanies.ADataBaseManagementSystem(DBMS)isanextremelycomplicatedsetofsoftwareprogramsthatcontrolstheorganization,storageandretrievalofdata(felids,recordsandfiles)inaDatabase.Italsocontrolsthesecurityandintegrityofthedatabases.TheDBMSacceptsrequestsfordatafromtheapplicationprogramandinstructstheoperatingsystemtotransfertheappropriatedata。Tasksthatwouldbetime-consumingtoaccomplishmanuallyaremorepracticaltheaidofthecomputer。Inprinciple,adatabaseinacomputerisnotdifferentfromadatabaserecordedonpaperandfiledincabinets.Butthecomputerdoesthetediousworkofmaintainingandaccessingadatabase,anddoesitfast.Acomputerizeddatabasethatcandoallthisisknownasadatabasemanagementsystem,orDBMSforshort。Thereareanumberofwaystostoreinformationinacomputer,butnotallofthesearetruedatabasemanagementsystems。WhenaDBMSisused,informationsystemscanbechangedmuchmoreeasilyastheorganization'stioinfreoqrumiarementschange.Newcategoriesofdatacanbeaddedtothedatabasewithoutdisruptiontotheexistingsystem。4。1.DBMS(DatabaseManagementSystem)DBMSisabletoaccessandretrievedatafromnonkeyrecordfields。Thatis,theDBMSisabletostructureandtietogetherthelogicallyrelateddatafromseverallargefiles.4.2。LogicalStructuresIdentifyingtheselogicalrelationshipsisajobofthedataadministrator。Adatadefinitionlanguageisusedforthispurpose.TheDBMSmaythenemployoneofthefollowinglogicalstructuringtechniquesduringstorageaccess,andretrievaloperations:Liststructures。Inthislogicalapproach,recordsarelinkedtogetherbytheuseofpointers.Apointerisadataiteminonerecordthatidentifiesthestoragelocationofanotherlogicallyrelatedrecord.Recordsinacustomermasterfile,forexample,willcontainthenameandaddressofeachcustomerandeachrecordinthisfileisidentifiedbyanaccountnumber。Duringanaccountingperiod,acustomermaybuyanumberofitemsondifferentdays。Thus,thecompanymaymaintainaninvoicefiletoreflectthesetransactions.Aliststructurecouldbeusedinthissituationtoshowtheunpaidinvoicesatanygiventime.Eachrecordinthecustomerfilewouldcontainafieldthatwouldpointtotherecordlocationofthefirstinvoiceforthatcustomerintheinvoicefile。Thisinvoicerecord,inturn,wouldbelinkedtolaterinvoicesforthecustomer。Thelastinvoiceinthechainwouldbeidentifiedbytheuseofaspecialcharacterasapointer。Hierarchical(tree)structures。Inthislogicalapproach,dataunitsarestructuredinmultiplelevelsthatgraphicallyresemblean"upsidedown"treewiththerootatthetopandthebranchesformedbelow。There'sasuperior-subordinaterelationshipinahierarchical(tree)structure。Belowthesingle-rootdatacomponentaresubordinateelementsornodes,eachofwhich,inturn,”own"oneormoreotherelements(ornone).Eachelementorbranchinthisstructurebelowtheroothasonlyasingleowner.Thus,acustomerownsaninvoice,andtheinvoicehassubordinateitems.Thebranchesinatreestructurearenotconnected.3。NetworkStructures。Unlikethetreeapproach,whichdoesnotpermittheconnectionofbranches,thenetworkstructurepermitstheconnectionofthenodesinamultidirectionalmanner。Thus,eachnodemayhaveseveralownersandmay,inturn,ownanynumberofotherdataunits.Datamanagementsoftwarepermitstheextractionoftheneededinformationfromsuchastructurebybeginningwithanyrecordinafile.5.DatabaseManagementSystems(DBMS)AndManagementInformationSystems(MIS)Youknowthatadatabaseisacollectionoflogicallyrelateddataelementsthatmaybestructuredinvariouswaystomeetthemultipleprocessingandretrievalneedsoforganizationsandindividuals.There'snothingnewaboutdatabases—earlyoneswerechiseledinstone,pennedonscrolls,andwrittenonindexcards.Butnowdatabasesarecommonlyrecordedonmagnetizablemedia,andcomputerprogramsarerequiredtoperformthenecessarystorageandretrievaloperations.You'llseeinthefollowingpagesthatcomplexdatarelationshipsandlinkagesmaybefoundinallbutthesimplestdatabases.Thesystemsoftwarepackagethathandlesthedifficulttasksassociatedwithcreating,accessing,andmaintainingdatabaserecordsiscalledadatabasemanagementsystem(DBMS).TheprogramsinaDBMSpackageestablishaninterfacebetweenthedatabaseitselfandtheusersofthedatabase.(Theseusersmaybeapplicationsprogrammers,managersandotherswithinformationneeds,andvariousOSprograms.)ADBMScanorganize,process,andpresentselecteddataelementsfromthedatabase.Thiscapabilityenablesdecisionmakerstosearch,probe,andquerydatabasecontentsinordertoextractanswerstononrecurringandunplannedquestionsthataren'tavailableinregularreports.Thesequestionsmightinitiallybevagueand/orpoorlydefined,butpeoplecan“browse"throughthedatabaseuntiltheyhavetheneededinformation.Inshort,theDBMSwill“manage"thestoreddataitemsandassembletheneededitemsfromthecommondatabaseinresponsetothequeriesofthosewhoaren'tprogrammers.Inafile-orientedsystem,usersneedingspecialinformationmaycommunicatetheirneedstoaprogrammer,who,whentimepermits,willwriteoneormoreprogramstoextractthedataandpreparetheinformation[4].TheavailabilityofaDBMS,however,offersusersamuchfasteralternativecommunicationspath。Themanagementinformationsystem(MIS)concepthasbeendefinedindozensofways.Sinceoneorganization'smodelofanMISislikelytodifferfromthatofanother,it'snotsurprisingthattheirMISdefinitionswouldalsovaryinscopeandbreadth.Forourpurposes,anMIScanbedefinedasanetworkofcomputer—baseddataprocessingproceduresdevelopedinanorganizationandintegratedasnecessarywithmanualandotherproceduresforthepurposeofprovidingtimelyandeffectiveinformationtosupportdecisionmakingandothernecessarymanagementfunctions.MIShasdifferentmodels,Inadditiontowhatmightbetermedthehorizontalmanagementstructure,anorganizationisalsodividedverticallyintodifferentspecialtiesandfunctionswhichrequireseparateinformationflows.Combiningthehorizontalmanageriallevelswiththeverticalspecialtiesproducesthecomplexorganizationalstructure.Underlyingthisstructureisadatabaseconsisting,ideally,ofinternallyandexternallyproduceddatarelatingtopast,present,andpredictedfutureevents。TheformidabletaskoftheMISdesigneristodeveloptheinformationflowneededtosupportdecisionmaking.Generallyspeaking,muchoftheinformationneededbymanagerswhooccupydifferentlevelsandwhohavedifferentresponsibilitiesisobtainedfromacollectionofexistinginformationsystem(sorsubsystems).ThesesystemsmaybetiedtogetherverycloselyinanMIS.Moreoften,however,theyaremorelooselycoupled.外文翻譯中文數(shù)據(jù)庫(kù)系統(tǒng)1.數(shù)據(jù)庫(kù)系統(tǒng)引論今天,也就是比以往任何時(shí)候都更加明顯,一個(gè)組織的成功取決于它準(zhǔn)確而及時(shí)地獲取關(guān)于它運(yùn)營(yíng)數(shù)據(jù)的能力及有效管理這些數(shù)據(jù)的能力,并用它來(lái)分析和指導(dǎo)其活動(dòng)。一些短語(yǔ)諸如“超級(jí)公路信息"已隨處可見(jiàn),信息處理成為一個(gè)迅速增長(zhǎng)為每年幾十億美元的產(chǎn)業(yè).我們今天能得到的信息實(shí)在是爆炸性的,而數(shù)據(jù)作為一個(gè)組織資產(chǎn)的價(jià)值正得到廣泛的認(rèn)可.這種議論推動(dòng)了對(duì)強(qiáng)大及靈活的數(shù)據(jù)庫(kù)管理系統(tǒng)的不斷增長(zhǎng)的需要。數(shù)據(jù)庫(kù)是一組數(shù)據(jù)的集合,它可典型地描繪一個(gè)或多個(gè)相關(guān)組織的活動(dòng).舉例來(lái)說(shuō),一個(gè)大學(xué)的數(shù)據(jù)庫(kù)可能包含如下信息:?諸如學(xué)生、教職員、課程及班組等實(shí)體。?實(shí)體間的關(guān)系,諸如學(xué)生課程名冊(cè)、教員教授課程以及課程使用教室.一個(gè)數(shù)據(jù)庫(kù)管理系統(tǒng)(或稱DBMS)是一種旨在協(xié)助維護(hù)和使用大型數(shù)據(jù)集合的軟件,為這些系統(tǒng)所需要,同時(shí)為了它們的使用,DBMS發(fā)展很迅速;舉例來(lái)說(shuō),在文件中存儲(chǔ)數(shù)據(jù)須書(shū)寫(xiě)特定的應(yīng)用代碼來(lái)管理它。一般來(lái)說(shuō),數(shù)據(jù)庫(kù)管理系統(tǒng)領(lǐng)域是計(jì)算機(jī)科學(xué)的一個(gè)縮影。它所要解決的問(wèn)題及使用的技術(shù)包括了廣泛的范圍,這包括語(yǔ)言、面向?qū)ο蠹捌渌木幊套兓椒ā⒕幾g、操作系統(tǒng)、并發(fā)編程、數(shù)據(jù)結(jié)構(gòu)、算法理論、并行及分布式系統(tǒng)、用戶接口、專家系統(tǒng)及人工智能、統(tǒng)計(jì)技術(shù)以及動(dòng)態(tài)編程.隨著愈來(lái)愈多的數(shù)據(jù)能進(jìn)入在線及通過(guò)計(jì)算機(jī)網(wǎng)絡(luò)變得從未有過(guò)的便于存取,數(shù)據(jù)庫(kù)管理系統(tǒng)將繼續(xù)增加其重要性.今天這個(gè)領(lǐng)域正在為激動(dòng)人心的多媒體數(shù)據(jù)庫(kù)、交互電視、數(shù)字圖書(shū)館及許多科學(xué)工程(諸如人類基因圖工程以及NASA的地球觀測(cè)工程)及許多公司為鞏固它們的決策處理愿望和為了挖掘它們自己公司的有用信息的數(shù)據(jù)倉(cāng)庫(kù)等所推動(dòng)。在商業(yè)方面,數(shù)據(jù)庫(kù)管理系統(tǒng)代表了一個(gè)最大和最強(qiáng)勁的市場(chǎng)份額,對(duì)數(shù)據(jù)庫(kù)管理系統(tǒng)的研究將被證明能在多個(gè)方面而不是一個(gè)方面得到豐厚的回報(bào)。2.數(shù)據(jù)庫(kù)概述一個(gè)數(shù)據(jù)庫(kù)由一個(gè)文件或文件集合組成。這些文件中的信息可分解成一個(gè)個(gè)記錄,每個(gè)記錄有一個(gè)或多個(gè)域。域是數(shù)據(jù)存儲(chǔ)的基本單位,每個(gè)域一般含有由數(shù)據(jù)庫(kù)描述的屬于實(shí)體的一個(gè)方面或一個(gè)特性的信息。用戶使用鍵盤和各種排序命令,能夠快速查找、重排、分組并在查找的許多記錄中選擇相應(yīng)的域,建立特定集上的報(bào)表。數(shù)據(jù)庫(kù)記錄和文件的組織必須確保能對(duì)信息進(jìn)行檢索。早期的系統(tǒng)是順序組織的(如:字母順序、數(shù)字順序或時(shí)間順序);直接訪問(wèn)存儲(chǔ)設(shè)備的研制成功使得通過(guò)索引隨機(jī)訪問(wèn)數(shù)據(jù)成為可能。用戶檢索數(shù)據(jù)庫(kù)信息的主要方法是query(查詢)。通常情況下,用戶提供一個(gè)字符串,計(jì)算機(jī)在數(shù)據(jù)庫(kù)中尋找相應(yīng)的字符序列,并且給出字符串在何處出現(xiàn)。比如,用戶能夠在所有記錄中尋找所有l(wèi)astname域?yàn)镾mith的記錄。在非結(jié)構(gòu)化的數(shù)據(jù)庫(kù)中,按照實(shí)體的一個(gè)簡(jiǎn)單列表組織記錄;很多個(gè)人計(jì)算機(jī)的簡(jiǎn)易數(shù)據(jù)庫(kù)是非結(jié)構(gòu)的.層次型數(shù)據(jù)庫(kù)按樹(shù)型組織記錄,每一層的記錄分解成更小的屬性集。層次型數(shù)據(jù)庫(kù)在不同層的記錄集之間提供一個(gè)單一鏈接,與此不同,網(wǎng)絡(luò)型數(shù)據(jù)庫(kù)在不同記錄集之間提供多個(gè)鏈接,這是通過(guò)設(shè)置指向其它記錄集的鏈或指針來(lái)實(shí)現(xiàn)的。網(wǎng)絡(luò)型數(shù)據(jù)庫(kù)的速度及多樣性使其在企業(yè)中得到廣泛應(yīng)用。當(dāng)文件或記錄間的關(guān)系不能用鏈表達(dá)時(shí),使用關(guān)系型數(shù)據(jù)庫(kù)。一個(gè)表或一個(gè)“關(guān)系”,就是一個(gè)簡(jiǎn)單的非結(jié)構(gòu)列表。多個(gè)關(guān)系可通過(guò)數(shù)學(xué)關(guān)系提供所需信息。面向?qū)ο蟮臄?shù)據(jù)庫(kù)存儲(chǔ)并處理更復(fù)雜的稱為對(duì)象的數(shù)據(jù)結(jié)構(gòu),可組織成有層次的類,其中的每個(gè)類可以繼承層次鏈中更高一級(jí)類的特性,這種數(shù)據(jù)庫(kù)結(jié)構(gòu)最靈活,最具適應(yīng)性。關(guān)系數(shù)據(jù)庫(kù)的結(jié)構(gòu)關(guān)系模型是任何關(guān)系數(shù)據(jù)庫(kù)管理系統(tǒng)(RDBMS)的基礎(chǔ)。一個(gè)關(guān)系模型有二個(gè)核心組件:對(duì)象或關(guān)系的集合,作用于對(duì)象或關(guān)系上的操作,以及數(shù)據(jù)完整性規(guī)則.換句話說(shuō),關(guān)系數(shù)據(jù)庫(kù)有一個(gè)存儲(chǔ)數(shù)據(jù)的地方,一種創(chuàng)建和檢索數(shù)據(jù)的方法,以及一種確認(rèn)數(shù)據(jù)的邏輯一致性的方法.一個(gè)關(guān)系數(shù)據(jù)庫(kù)使用關(guān)系或二維表來(lái)存儲(chǔ)支持某個(gè)事物所需的信息.讓我們了解一下一個(gè)傳統(tǒng)的關(guān)系數(shù)據(jù)庫(kù)系統(tǒng)的基本組件并且學(xué)習(xí)如何設(shè)計(jì)一個(gè)關(guān)系數(shù)據(jù)庫(kù)。一旦你對(duì)于行、列、表和關(guān)聯(lián)是什么有了深刻理解,你就能夠充分發(fā)揮關(guān)系數(shù)據(jù)庫(kù)的強(qiáng)大功能。3.1表,行和列在關(guān)系數(shù)據(jù)庫(kù)中,一個(gè)表(或者說(shuō)一個(gè)關(guān)系)是一個(gè)用于保存相關(guān)信息的二維結(jié)構(gòu).一個(gè)數(shù)據(jù)庫(kù)由一個(gè)或者多個(gè)相關(guān)聯(lián)的表組成。注意:不要混淆了關(guān)系和關(guān)聯(lián)。一個(gè)關(guān)系實(shí)際上是一個(gè)表,而一個(gè)關(guān)聯(lián)指的是一種連接、結(jié)合或聯(lián)合兩個(gè)表的方式。表中的一行是一種事物的集合或?qū)嵗?比如一個(gè)員工或發(fā)票上的一項(xiàng).表中的一列包含了一類信息;而且行列交叉點(diǎn)上的數(shù)據(jù),字段,即是能夠用數(shù)據(jù)庫(kù)查詢語(yǔ)言檢索到的最小片信息。舉個(gè)例子來(lái)說(shuō),一個(gè)員工信息表可能有一個(gè)“名字”列,列中就包含所有員工的名字.數(shù)據(jù)是通過(guò)對(duì)行、列進(jìn)行過(guò)濾而從表中檢索出來(lái)的。3.2。主碼,數(shù)據(jù)類型和外碼關(guān)系:用來(lái)保存相關(guān)信息的一個(gè)二維結(jié)構(gòu)(也就是表).行:在一個(gè)數(shù)據(jù)庫(kù)表中的一組單數(shù)據(jù)或多數(shù)據(jù)元素,用于描述一個(gè)人、地方或事物。列:列是數(shù)據(jù)庫(kù)表的組件,它包含所有行中同名和同類型的所有數(shù)據(jù).一個(gè)關(guān)系數(shù)據(jù)庫(kù)能夠規(guī)定列中的一個(gè)單元格是否為空。單元格:是數(shù)據(jù)庫(kù)查詢語(yǔ)言所能夠檢索到的最小片信息。一個(gè)單元格就是一個(gè)數(shù)據(jù)庫(kù)表的行和列交叉形成的.關(guān)系數(shù)據(jù)庫(kù)的一個(gè)特性能夠確定某列的鍵入值必須為單值。主碼:主碼即是表中的一列(或多列),使每一行能夠區(qū)別于同表中的其他行.數(shù)據(jù)類型:數(shù)值型,字符型或字母型,以及日期型。外碼加強(qiáng)了關(guān)系數(shù)據(jù)庫(kù)中參考完整性的概念。外碼:表中的一列(或多列),它的值來(lái)自于其他表的主碼列或單值列。一個(gè)外碼有助于確定表中數(shù)據(jù)的完整性。參考完整性:是關(guān)系數(shù)據(jù)庫(kù)用來(lái)加強(qiáng)表間一對(duì)多關(guān)聯(lián)的一種方式。3.3數(shù)據(jù)建模在這個(gè)過(guò)程中,數(shù)據(jù)庫(kù)創(chuàng)建者定義和填寫(xiě)數(shù)據(jù)庫(kù)中所有表。有一種為數(shù)據(jù)庫(kù)建模的方式叫做ERA,它可以表示出實(shí)體、實(shí)體間的關(guān)聯(lián)和實(shí)體的屬性。數(shù)據(jù)庫(kù)設(shè)計(jì)者使用一個(gè)能夠支持實(shí)體、實(shí)體屬性和實(shí)體間關(guān)聯(lián)的應(yīng)用程序。通常,一個(gè)實(shí)體對(duì)應(yīng)數(shù)據(jù)庫(kù)中的一個(gè)表,而實(shí)體的屬性對(duì)應(yīng)于表中的列。數(shù)據(jù)建模:一個(gè)定義實(shí)體、實(shí)體屬性和實(shí)體間關(guān)聯(lián)的過(guò)程,從而為建立物理數(shù)據(jù)庫(kù)做準(zhǔn)備。數(shù)據(jù)建模過(guò)程包括定義實(shí)體、定義實(shí)體間關(guān)聯(lián)以及定義每個(gè)實(shí)體的屬性的過(guò)程。一旦一個(gè)周期完成,就需要不斷重復(fù)直到設(shè)計(jì)者抓住了重點(diǎn),足以開(kāi)始建立數(shù)據(jù)庫(kù)。讓我們進(jìn)一步了解為數(shù)據(jù)庫(kù)建模過(guò)程的步驟。定義實(shí)體首先,設(shè)計(jì)者確定數(shù)據(jù)庫(kù)應(yīng)用程序范圍內(nèi)的所有實(shí)體。實(shí)體是人、地方或事物,它們對(duì)于整個(gè)團(tuán)體是重要的且需要被記錄在數(shù)據(jù)庫(kù)中.實(shí)體將被巧妙的轉(zhuǎn)化為數(shù)據(jù)表。3.5。定義實(shí)體間的關(guān)聯(lián)一旦定義了實(shí)體,設(shè)計(jì)者就能夠繼續(xù)定義每個(gè)實(shí)體間是如何關(guān)聯(lián)的。通常,設(shè)計(jì)者通常將每個(gè)實(shí)體同其他實(shí)體配對(duì),并目考慮:“兩者之間是否存在關(guān)聯(lián)呢?”實(shí)體間的某些關(guān)聯(lián)是明顯的,某些不是。在飾品公司數(shù)據(jù)庫(kù)中,員工實(shí)體和部門實(shí)體間極可能存在關(guān)聯(lián),而依據(jù)事物間的關(guān)系原則,部門實(shí)體跟工資水平實(shí)體間似乎就沒(méi)有關(guān)聯(lián)了。如果事物間的關(guān)系原則是用來(lái)約束某個(gè)部門的工資水平的,就可能需要一個(gè)新的實(shí)體來(lái)說(shuō)明工資水平和部門之間的關(guān)聯(lián)。這個(gè)實(shí)體被稱作關(guān)系表或交表,其中包含工資水平和部門之間的有效聯(lián)合。關(guān)系表:是一個(gè)數(shù)據(jù)庫(kù)表,其中保存著另外兩個(gè)表的行(記錄)間的有效結(jié)合,并且通常強(qiáng)調(diào)了事物間的關(guān)系原則。關(guān)聯(lián)表處理的是一個(gè)多對(duì)多關(guān)聯(lián)。通常,關(guān)系數(shù)據(jù)庫(kù)間有二種關(guān)聯(lián)方式:?一對(duì)多關(guān)聯(lián):最常見(jiàn)的關(guān)聯(lián)是一對(duì)多關(guān)聯(lián)。意思是對(duì)于每個(gè)給出的現(xiàn)有實(shí)體(即父實(shí)體)都有一個(gè)或多個(gè)現(xiàn)有的另一個(gè)實(shí)體(即子實(shí)體)與之相關(guān)聯(lián).舉個(gè)例子來(lái)說(shuō),在飾品公司數(shù)據(jù)庫(kù)中,部門實(shí)體是一個(gè)父實(shí)體,而每個(gè)部門中,都有一個(gè)或多個(gè)員工屬于該部門.這樣,部門實(shí)體和員工實(shí)體間的關(guān)聯(lián)就是一對(duì)多關(guān)聯(lián)。?一對(duì)一關(guān)聯(lián):在一個(gè)一對(duì)一關(guān)聯(lián)中,表中的一行只關(guān)聯(lián)另一個(gè)表中的一行甚至0行。這種關(guān)聯(lián)類型通常用于子類型數(shù)據(jù)中.例如,一個(gè)員工表可能保存了所有員工的信息,而全職表、兼職表和承包人表則分別保存全職員工、兼職員工和承包人的信息。這些實(shí)體被認(rèn)為是員工表的子表,并且同員工表維持一對(duì)一關(guān)聯(lián)。這種關(guān)系不像一對(duì)多關(guān)聯(lián)那么常見(jiàn),因?yàn)槿绻粋€(gè)實(shí)體與另一個(gè)實(shí)體總有對(duì)應(yīng)行,在大多數(shù)情況下,兩個(gè)實(shí)體中的屬性只在一個(gè)實(shí)體內(nèi)出現(xiàn)就可以了。?多對(duì)多關(guān)聯(lián):在多對(duì)多關(guān)聯(lián)中,表的一行可能對(duì)應(yīng)另一個(gè)表的許多行,反之亦然.通常,當(dāng)這些關(guān)聯(lián)在數(shù)據(jù)庫(kù)中被執(zhí)行時(shí),往往再定義第三個(gè)實(shí)體用來(lái)保存前兩個(gè)實(shí)體間的所有關(guān)聯(lián).例如,在一個(gè)學(xué)籍注冊(cè)數(shù)據(jù)庫(kù)中,學(xué)生表與班級(jí)表之間有一個(gè)多對(duì)多關(guān)聯(lián)—-一個(gè)學(xué)生可能聽(tīng)一門或多門課程,并目一個(gè)班級(jí)也可能有一個(gè)或多個(gè)學(xué)生。而學(xué)生_班級(jí)關(guān)系表中就包含了學(xué)生和班級(jí)之間的關(guān)系,以表明哪個(gè)學(xué)生在哪個(gè)班。DBMS簡(jiǎn)介數(shù)據(jù)庫(kù)這個(gè)詞經(jīng)常用來(lái)描述
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 新疆警察學(xué)院《英語(yǔ)課程設(shè)計(jì)》2023-2024學(xué)年第一學(xué)期期末試卷
- 柜臺(tái)改裝維修合同范例
- 項(xiàng)目保潔合同范例
- 出售改裝雅閣車輛合同范例
- pvc管材料合同范例
- 退房申請(qǐng)退房合同范例
- 借款合同范例3篇
- 跨境代運(yùn)營(yíng)合同范例
- 酒吧供銷合同范例
- 代理記賬合同范例封面
- 醫(yī)藥行業(yè)合規(guī)培訓(xùn)
- 2024年低壓電工資格考試必考題庫(kù)及答案(共400題)
- 【MOOC】公司金融-江西財(cái)經(jīng)大學(xué) 中國(guó)大學(xué)慕課MOOC答案
- 世界衛(wèi)生組織人類精液及精子-宮頸粘液相互作用實(shí)驗(yàn)室檢驗(yàn)手冊(cè)第五版
- 殯儀館鮮花采購(gòu)?fù)稑?biāo)方案(技術(shù)方案)
- 2024-2025學(xué)年人教版七年級(jí)英語(yǔ)上冊(cè)各單元重點(diǎn)句子
- 消化道大出血應(yīng)急預(yù)案演練
- 光伏項(xiàng)目達(dá)標(biāo)投產(chǎn)實(shí)施細(xì)則-施工
- 信息技術(shù)行業(yè)數(shù)據(jù)安全HSE方案
- 中國(guó)的世界文化遺產(chǎn)-英文版
- 系統(tǒng)集成售前技術(shù)年終總結(jié)
評(píng)論
0/150
提交評(píng)論