SQL数据库英文文献及翻译

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

SQL数据库英文文献及翻译ThefactthatyouarereadingabookonSQLindicatesthatyou,somehow,needtointeractwithdatabases.SQLisalanguageusedtodojustthis,sobeforelookingatSQLitself,itisimportantthatyouunderstandsomebasicconceptsaboutdatabasesanddatabasetechnologies.Whetheryouareawareofitornot,youusedatabasesallthetime.Eachtimeyouselectanamefromyouremailaddressbook,youareusingadatabase.IfyouconductasearchonanInternetsearchsite,youareusingadatabase.Whenyoulogintoyournetworkatwork,youarevalidatingyournameandpasswordagainstadatabase.EvenwhenyouuseyourATMcardatacashmachine,youareusingdatabasesforPINnumberverificationandbalancechecking.Buteventhoughweallusedatabasesallthetime,thereremainsmuchconfusionoverwhatexactlyadatabaseis.Thisisespeciallytruebecausedifferentpeopleusethesamedatabasetermstomeandifferentthings.Therefore,agoodplacetostartourstudyiswithalistandexplanationofthemostimportantdatabaseterms.ReviewingBasicConceptsWhatfollowsisaverybriefoverviewofsomebasicdatabaseconcepts.Itisintendedtoeitherjoltyourmemoryifyoualreadyhavesomedatabaseexperience,ortoprovideyouwiththeabsolutebasics,ifyouarenewtodatabases.UnderstandingdatabasesisanimportantpartofmasteringSQL,andyoumightwanttofindagoodbookondatabasefundamentalstobrushuponthesubjectifneeded.WhatIsaDatabase?Thetermdatabaseisusedinmanyorganizedfashion.Thesimplestwaytothinkofitistoimagineadatabaseasafilingcabinet.Thefilingcabinetissimplyaphysicallocationtostoredata,regardlessofwhatthatdataisorhowitisorganizedDatabaseAcontainer(usuallyafileorsetoffiles)tostoreorganizeddata.MisuseCausesConfusionPeopleoftenusethetermdatabasetorefertothedatabasesoftwaretheyarerunning.Thisisincorrect,anditisasourceofmuchconfusion.DatabasesoftwareisactuallycalledtheDatabaseManagementSystem(orDBMS).ThedatabaseisthecontainercreatedandmanipulatedviatheDBMS.Adatabasemightbeafilestoredonaharddrive,butitmightnot.Andforthemostpartthisisnotevensignificantasyouneveraccessadatabasedirectlyanyway;youalwaysusetheDBMSanditaccessesthedatabaseforyou.TablesWhenyoustoreinformationinyourfilingcabinetyoudon'tjusttossitinadrawer.Rather,youcreatefileswithinthefilingcabinet,andthenyoufilerelateddatainspecificfiles.Inthedatabaseworld,thatfileiscalledatable.Atableisastructuredfilethatcanstoredataofaspecifictype.Atablemightcontainalistofcustomers,aproductcatalog,oranyotherlistofinformation.TableAstructuredlistofdataofaspecifictype.Thekeyhereisthatthedatastoredinthetableisonetypeofdataoronelist.Youwouldneverstorealistofcustomersandalistofordersinthesamedatabasetable.Doingsowouldmakesubsequentretrievalandaccessdifficult.Rather,you'dcreatetwotables,oneforeachlist.Everytableinadatabasehasanamethatidentifiesit.Thatnameisalwaysunique—meaningnoothertableinthatdatabasecanhavethesamename.TableNamesWhatmakesatablenameuniqueisactuallyacombinationofseveralthingsincludingthedatabasenameandtablename.Somedatabasesalsousethenameofthedatabaseowneraspartoftheuniquename.Thismeansthatwhileyoucannotusethesametablenametwiceinthesamedatabase,youdefinitelycanreusetablenamesindifferentdatabases.Tableshavecharacteristicsandpropertiesthatdefinehowdataisstoredinthem.Theseincludeinformationaboutwhatdatamaybestored,howitisbrokenup,howindividualpiecesofinformationarenamed,andmuchmore.Thissetofinformationthatdescribesatableisknownasaschema,andschemaareusedtodescribespecifictableswithinadatabase,aswellasentiredatabases(andtherelationshipbetweentablesinthem,ifany).SchemaInformationaboutdatabaseandtablelayoutandproperties.ColumnsandDatatypesTablesaremadeupofcolumns.Acolumncontainsaparticularpieceofinformationwithinatable.ColumnAsinglefieldinatable.Alltablesaremadeupofoneormorecolumns.Thebestwaytounderstandthisistoenvisiondatabasetablesasgrids,somewhatlikespreadsheets.Eachcolumninthegridcontainsaparticularpieceofinformation.Inacustomertable,forexample,onecolumncontainsthecustomernumber,anothercontainsthecustomername,andtheaddress,city,state,andzipareallstoredintheirowncolumnsBreakingUpDataItisextremelyimportanttobreakdataintomultiplecolumnscorrectly.Forexample,city,state,andzipshouldalwaysbeseparatecolumns.Bybreakingtheseout,itbecomespossibletosortorfilterdatabyspecificcolumns(forexample,tofindallcustomersinaparticularstateorinaparticularcity).Ifcityandstatearecombinedintoonecolumn,itwouldbeextremelydifficulttosortorfilterbystate.1657Eachcolumninadatabasehasanassociateddatatype.Adatatypedefineswhattypeofdatathecolumncancontain.Forexample,ifthecolumnistocontainanumber(perhapsthenumberofitemsinanorder),thedatatypewouldbeanumericdatatype.Ifthecolumnweretocontaindates,text,notes,currencyamounts,andsoon,theappropriatedatatypewouldbeusedtospecifythis.DatatypeAtypeofalloweddata.Everytablecolumnhasanassociateddatatypethatrestricts(orallows)specificdatainthatcolumn.Datatypesrestrictthetypeofdatathatcanbestoredinacolumn(forexample,preventingtheentryofalphabeticalcharactersintoanumericfield).Datatypesalsohelpsortdatacorrectly,andplayanimportantroleinoptimizingdiskusage.Assuch,specialattentionmustbegiventopickingtherightdatatypewhentablesarecreated.DatatypeCompatibilityDatatypes

1 / 3
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功