![外文翻譯--關(guān)系數(shù)據(jù)庫的結(jié)構(gòu).doc_第1頁](http://file.renrendoc.com/FileRoot1/2013-11/17/87ea3fe7-0bb0-4afc-bbf5-2d154ea04730/87ea3fe7-0bb0-4afc-bbf5-2d154ea047301.gif)
![外文翻譯--關(guān)系數(shù)據(jù)庫的結(jié)構(gòu).doc_第2頁](http://file.renrendoc.com/FileRoot1/2013-11/17/87ea3fe7-0bb0-4afc-bbf5-2d154ea04730/87ea3fe7-0bb0-4afc-bbf5-2d154ea047302.gif)
![外文翻譯--關(guān)系數(shù)據(jù)庫的結(jié)構(gòu).doc_第3頁](http://file.renrendoc.com/FileRoot1/2013-11/17/87ea3fe7-0bb0-4afc-bbf5-2d154ea04730/87ea3fe7-0bb0-4afc-bbf5-2d154ea047303.gif)
![外文翻譯--關(guān)系數(shù)據(jù)庫的結(jié)構(gòu).doc_第4頁](http://file.renrendoc.com/FileRoot1/2013-11/17/87ea3fe7-0bb0-4afc-bbf5-2d154ea04730/87ea3fe7-0bb0-4afc-bbf5-2d154ea047304.gif)
![外文翻譯--關(guān)系數(shù)據(jù)庫的結(jié)構(gòu).doc_第5頁](http://file.renrendoc.com/FileRoot1/2013-11/17/87ea3fe7-0bb0-4afc-bbf5-2d154ea04730/87ea3fe7-0bb0-4afc-bbf5-2d154ea047305.gif)
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
StructureoftherelationaldatabaseTherelationalmodelisthebasisforanyrelationaldatabasemanagementsystem(RDBMS).Arelationalmodelhasthreecorecomponents:acollectionofobjectsorrelations,operatorsthatactontheobjectsorrelations,anddataintegritymethods.Inotherwords,ithasaplacetostorethedata,awaytocreateandretrievethedata,andawaytomakesurethatthedataislogicallyconsistent.Arelationaldatabaseusesrelations,ortwo-dimensionaltables,tostoretheinformationneededtosupportabusiness.Letsgooverthebasiccomponentsofatraditionalrelationaldatabasesystemandlookathowarelationaldatabaseisdesigned.Onceyouhaveasolidunderstandingofwhatrows,columns,tables,andrelationshipsare,youllbewellonyourwaytoleveragingthepowerofarelationaldatabase.Tables,Rows,andColumnsAtableinarelationaldatabase,alternativelyknownasarelation,isatwo-dimensionalstructureusedtoholdrelatedinformation.Adatabaseconsistsofoneormorerelatedtables.Note:Dontconfusearelationwithrelationships.Arelationisessentiallyatable,andarelationshipisawaytocorrelate,join,orassociatetwotables.Arowinatableisacollectionorinstanceofonething,suchasoneemployeeoronelineItemonaninvoice.Acolumncontainsalltheinformationofasingletype,andthepieceofdataattheintersectionofarowandacolumn,afield,isthesmallestpieceofinformationthatcanberetrievedwiththedatabasesquerylanguage.Forexample,atablewithinformationaboutemployeesmighthaveacolumncalledLAST_NAMEthatcontainsalloftheemployeeslastnames.Dataisretrievedfromatablebyfilteringonboththerowandthecolumn.PrimaryKeys,Datatypes,andForeignKeysTheexamplesthroughoutthisarticlewillfocusonthehypotheticalworkofScottSmith,databasedeveloperandentrepreneur.HejuststartedanewwidgetcompanyandwantstoimplementafewofthebasicbusinessfunctionsusingtherelationaldatabasetomanagehisHumanResources(HR)department.Relation:Atwo-dimensionalstructureusedtoholdrelatedinformation,alsoknownasatable.Note:MostofScottsemployeeswerehiredawayfromoneofhispreviousemployers,someofwhomhaveover20yearsofexperienceinthefield.Asahiringincentive,Scotthasagreedtokeepthenewemployeesoriginalhiredateinthenewdatabase.Row:Agroupofoneormoredataelementsinadatabasetablethatdescribesaperson,place,orthing.Column:Thecomponentofadatabasetablethatcontainsallofthedataofthesamenameandtypeacrossallrows.Youlllearnaboutdatabasedesigninthefollowingsections,butletsassumeforthemomentthatthemajorityofthedatabasedesigniscompletedandsometablesneedtobeimplemented.ScottcreatestheEMPtabletoholdthebasicemployeeinformation,anditlookssomethinglikethis:EMPNOENAMEJOBMGRHIREDATESALCOMMDEPTNO7369SMITHCLERK790217-DEC-80800207499ALLENSALESMAN769820-FEB-811600300307521WARDSALESMAN769822-FEB-811250500307566JONESMANAGER783902-APR-812975207839KINGPRESIDENT17-NOV-815000107902FORDANALYST756603-DEC-81300020NoticethatsomefieldsintheCommission(COMM)andManager(MGR)columnsdoesnotcontainavalue;theyareblank.Arelationaldatabasecanenforcetherulethatfieldsinacolumnmayormaynotbeempty.3Inthiscase,itmakessenseforanemployeewhoisnotintheSalesdepartmenttohaveablankCommissionfield.ItalsomakessenseforthepresidentofthecompanytohaveablankManagerField,sincethatemployeedoesntreporttoanyone.Field:Thesmallestpieceofinformationthatcanberetrievedbythedatabasequerylanguage.Afieldisfoundattheintersectionofarowandacolumninadatabasetable.Ontheotherhand,noneofthefieldsintheEmployeeNumber(EMPNO)columnareblank.Thecompanyalwayswantstoassignanemployeenumbertoanemployee,andthatnumbermustbedifferentforeachemployee.Oneofthefeaturesofarelationaldatabaseisthatitcanensurethatavalueisenteredintothiscolumnandthatitisunique.TheEMPNOcolumn,inthiscase,istheprimarykeyofthetable.PrimaryKey:Acolumn(orcolumns)inatablethatmakestherowinthetabledistinguishablefromeveryotherrowinthesametable.NoticethedifferentdatatypesthatarestoredintheEMPtable:numericvalues,characteroralphabeticvalues,anddatevalues.Asyoumightsuspect,theDEPTNOcolumncontainsthedepartmentnumberfortheemployee.Buthowdoyouknowwhatdepartmentnameisassociatedwithwhatnumber?ScottcreatedtheDEPTtabletoholdthedescriptionsforthedepartmentcodesintheEMPtable.DEPTNODNAMELOC10ACCOUNTINGNEWYORK20RESEARCHDALLAS30SALESCHICAGO40OPERATIONSBOSTONTheDEPTNOcolumnintheEMPtablecontainsthesamevaluesastheDEPTNOcolumnintheDEPTtable.Inthiscase,theDEPTNOcolumnintheEMPtableisconsideredaforeignkeytothesamecolumnintheDEPTtable.Aforeignkeyenforcestheconceptofreferentialintegrityinarelationaldatabase.TheconceptofreferentialintegritynotonlypreventsaninvaliddepartmentnumberfrombeinginsertedintotheEMPtable,butitalsopreventsarowintheDEPTtablefrombeingdeletedifthereareemployeesstillassignedtothatdepartment.ForeignKey:Acolumn(orcolumns)inatablethatdrawsitsvaluesfromaprimaryoruniquekeycolumninanothertable.Aforeignkeyassistsinensuringthedataintegrityofatable.ReferentialIntegrity:Amethodemployedbyarelationaldatabasesystemthatenforcesone-to-manyrelationshipsbetweentables.DataModelingBeforeScottcreatedtheactualtablesinthedatabase,hewentthroughadesignprocessknownasdatamodeling.Inthisprocess,thedeveloperconceptualizesanddocumentsallthetablesforthedatabase.OneofthecommonmethodsformodelingadatabaseiscalledERA,whichstandsforentities,relationships,andattributes.Thedatabasedesignerusesanapplicationthatcanmaintainentities,theirattributes,andtheirrelationships.Ingeneral,anentitycorrespondstoatableinthedatabase,andtheattributesoftheentitycorrespondtocolumnsofthetable.DataModeling:Aprocessofdefiningtheentities,attributes,andrelationshipsbetweentheentitiesinpreparationforcreatingthephysicaldatabase.Thedata-modelingprocessinvolvesdefiningtheentities,definingtherelationshipsbetweenthoseentities,andthendefiningtheattributesforeachoftheentities.Onceacycleiscomplete,itisrepeatedasmanytimesasnecessarytoensurethatthedesigneriscapturingwhatisimportantenoughtogointothedatabase.Letstakeacloserlookateachstepinthedata-modelingprocess.DefiningtheEntitiesFirst,thedesigneridentifiesalloftheentitieswithinthescopeofthedatabaseapplication.Theentitiesarethepersons,places,orthingsthatareimportanttotheorganizationandneedtobetrackedinthedatabase.Entitieswillmostlikelytranslateneatlytodatabasetables.Forexample,forthefirstversionofScottswidgetcompanydatabase,heidentifiesfourentities:employees,departments,salarygrades,andbonuses.ThesewillbecometheEMP,DEPT,SALGRADE,andBONUStables.DefiningtheRelationshipsbetweenEntitiesOncetheentitiesaredefined,thedesignercanproceedwithdefininghoweachoftheentitiesisrelated.Often,thedesignerwillpaireachentitywitheveryotherentityandask,Istherearelationshipbetweenthesetwoentities?Somerelationshipsareobvious;somearenot.Inthewidgetcompanydatabase,thereismostlikelyarelationshipbetweenEMPandDEPT,butdependingonthebusinessrules,itisunlikelythattheDEPTandSALGRADEentitiesarerelated.Ifthebusinessrulesweretorestrictcertainsalarygradestocertaindepartments,therewouldmostlikelybeanewentitythatdefinestherelationshipbetweensalarygradesanddepartments.Thisentitywouldbeknownasanassociativeorintersectiontableandwouldcontainthevalidcombinationsofsalarygradesanddepartments.AssociativeTable:Adatabasetablethatstoresthevalidcombinationsofrowsfromtwoothertablesandusuallyenforcesa
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 科技沙發(fā)布料的創(chuàng)新設(shè)計與制作工藝
- 老年人居住的小戶型公寓設(shè)計要點
- DB35T 2240-2024公共數(shù)據(jù)清洗技術(shù)要求
- 二手房轉(zhuǎn)讓合同樣本大全
- 中外雙向投資合同
- 專業(yè)派遣人員勞務(wù)合同范本
- 上海市設(shè)備采購合同模版
- 不動產(chǎn)附條件贈與合同協(xié)議書
- 個人借款延期還款合同模板
- 個人房產(chǎn)互換合同
- 2023高考語文全國甲卷詩歌閱讀題晁補之《臨江仙 身外閑愁空滿眼》講評課件
- 數(shù)字營銷廣告技術(shù)行業(yè)rta巨量引擎實時接口
- 化工企業(yè)靜電安全檢查規(guī)程
- 線性系統(tǒng)理論鄭大鐘第二版
- 寧騷公共政策學完整版筆記
- 項目負責人考試題庫含答案
- GB/T 7251.5-2017低壓成套開關(guān)設(shè)備和控制設(shè)備第5部分:公用電網(wǎng)電力配電成套設(shè)備
- 2023年湖南高速鐵路職業(yè)技術(shù)學院高職單招(數(shù)學)試題庫含答案解析
- 勇者斗惡龍9(DQ9)全任務(wù)攻略
- 經(jīng)顱磁刺激的基礎(chǔ)知識及臨床應(yīng)用參考教學課件
- 小學語文人教四年級上冊第四單元群文閱讀“神話故事之人物形象”PPT
評論
0/150
提交評論