A first course in Database Systems(1)ppt课件_第1页
A first course in Database Systems(1)ppt课件_第2页
A first course in Database Systems(1)ppt课件_第3页
A first course in Database Systems(1)ppt课件_第4页
A first course in Database Systems(1)ppt课件_第5页
已阅读5页,还剩30页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

AFirstCourseinDatabaseSystems Departmentofcomputerscience technologyNJUST AFirstCourseinDatabaseSystems 2 5学分上课 0 5学分上机 共3学分 学习目的 掌握数据库系统的基本概念 原理和方法 学会如何有效地使用数据库管理系统 包括数据库的设计和对数据库的编程 学习方法 理论结合实践 考核方式及要求 作业 20 按时认真完成作业 实验 10 完成上机实验并提交实验报告 闭卷考试 70 英文试卷 AFirstCourseinDatabaseSystems ReferencebooksJeffreyD Ullman JenniferWidom 数据库系统基础教程 岳丽华等译 机械工业出版社 2003 AbrahamSilberschatz HenryF Korth S Sudarshan 数据库系统概念 杨冬青等译 机械工业出版社 2003 黄明等编著 Delphi7信息系统设计与开发实例 机械工业出版社 2004 http www db stanford edu ullman fcdb html TheWorldsofDatabaseSystemTheEntity RelationshipDataModelTheRelationalDataModelOtherDataModelsRelationaiAlgebraTheDatabaseLanguageSQLConstraintsandTriggersSystemAspectsofSQL AFirstCourseinDatabaseSystems 1TheWorldsofDatabaseSystems TheEvolutionofDatabaseSystemsOverviewofaDBMSOutlineofDatabase SystemsStudies 1 1TheEvolutionofDatabaseSystems What sadatabase Inessence adatabaseisacollectionofinformationthatexistsoveralongperiodoftime oftenmanyyears Incommon adatabaseisacollectionofdatathatismanagedbyadatabasemanagementsystem DBMS 1 1TheEvolutionofDatabaseSystems DatabaseApplications Banking alltransactionsAirlines reservations schedulesUniversities registration gradesSales customers products purchasesManufacturing production inventory orders supplychainHumanresources employeerecords salaries taxdeductionsDatabasestouchallaspectsofourlives 1 1TheEvolutionofDatabaseSystems ADBMSisexpectedto DataDefinitionLanguage DDL createdatabasesandspecifytheirschema 模式 AschemaisagroupofcollectionsofsentencesthatareexpressedbyDDLtodescribethelogicalstructureofsomedatabasecompletely DataQueryLanguageandDataManipulationLanguage query 查询 andmodify 更新 thedatabasedontheschemaofthedatabase Supportthestorageofverylargeamountsofdata gigabytesormore overalongperiodoftime SupportDatasharing 共享 controlaccesstodatafrommanyusersatonce withoutallowingtheactionofoneusertoaffectotherusers withoutallowingsimultaneousaccessestocorruptthedataaccidentally 1 1TheEvolutionofDatabaseSystems Databasesystemsevolvedfromfilesystems DataredundancyandinconsistencyMultiplefileformats duplicationofinformationindifferentfiles DifficultyinaccessingdataNeedtowriteanewprogramtocarryouteachnewtask Dataisolation multiplefilesandformats IntegrityproblemsIntegrityconstraints e g accountbalance 0 become buried inprogramcoderatherthanbeingstatedexplicitly Hardtoaddnewconstraintsorchangeexistingones 1 1TheEvolutionofDatabaseSystems AtomicityofupdatesFailuresmayleavedatabaseinaninconsistentstatewithpartialupdatescarriedout Example Transferoffundsfromoneaccounttoanothershouldeithercompleteornothappenatall ConcurrentaccessbymultipleusersConcurrentaccessedneededforperformance Uncontrolledconcurrentaccessescanleadtoinconsistencies Example Twopeoplereadingabalanceandupdatingitatthesametime SecurityproblemsHardtoprovideuseraccesstosome butnotall data 1 1TheEvolutionofDatabaseSystems Late1960sand1970s HarddisksallowdirectaccesstodataNetworkandhierarchicaldatamodelsinwidespreaduseTheearlyDBMSdidn tsupporthigh levelquerylanguages 1 1TheEvolutionofDatabaseSystems 1970 TedCodddefinestherelationaldatamodelWouldwintheACMTuringAwardforthisworkIBMResearchbeginsSystemRprototypeMainidea organizeallthedataindatabaseastablescalledrelations Queriescouldbeexpressedinaveryhigh levellanguagetoincreasetheefficiencyofdatabaseprogrammers 1 1TheEvolutionofDatabaseSystems 1980s ResearchrelationalprototypesevolveintocommercialsystemsSQLbecomesindustrialstandardParallelanddistributeddatabasesystemsObject orienteddatabasesystems 1990s Largedecisionsupportanddata mining 数据挖掘 applicationsLargemulti terabytedatawarehousesEmergenceofWebcommerce 2000s XMLandXQuerystandardsAutomateddatabaseadministration 1 2OverviewofaDatabaseManagementSystem ADBMSisapowerfultoolforcreatingandmanaginglargeamountsofdataefficientlyandallowingittopersistoverlongperiodsoftime safely 1 2OverviewofaDatabaseManagementSystem 1 2OverviewofaDatabaseManagementSystem Application1 Application2 Applicationn DBMS database DatabaseManagementSystem 1 2OverviewofaDatabaseManagementSystem Storagemanager Buffermanager read writepages buffers index file recordmanger pagecommands data metadata indexs Executionengine index file andrecordrequests Querycompiler Queryplan Queries updates User application Transactionmanager DDLcompiler DDLcommands Databaseadministrator Transactioncommands Loggingandrecovery Concurrencycontrol Locktable logpages metadata Metadata statistics 单线框系统成分双线框内存中的数据结构实线控制和数据流虚线数据流 1 2OverviewofaDatabaseManagementSystem Twotypesofuser ConventionalusersandapplicationprogramsAdatabaseadministrator DBA ThreetypesofinputstotheDBMS Queries questionsaboutthedatatwoways SQL APIModifications operationstomodifythedataSchemamodifications commandstochangetheschemaofthedatabaseorcreateanewdatabasebydatabaseadministrators DDLcommands 1 2OverviewofaDatabaseManagementSystem Queryprocessor QuerycompilerTranslatesthequeryintoaninternalformcalledaqueryplan Aqueryparser 分析器 AquerypreprocessorAqueryoptimizer 优化器 ExecutionengineItgetsthedatafromthedatabaseintobuffersinordertomanipulatethatdata Itneedstointeractwiththeschedulertoavoidaccessingdatathatislocked andwiththelogmanagertomakesurethatalldatabasechangesareproperlylogged 1 2OverviewofaDatabaseManagementSystem Storage Aplacewheredataisstored containsdataandmetadataData thecontentsofthedatabaseitself Metadata 元数据 thedatabaseschemathatdescribesthestructureof andconstraintson thedatabase Indexes datastructuresthatsupportefficientaccesstothedata Indexesarepartofthestoreddata andadescriptionofwhichattributeshaveindexesispartofthemetadata 1 2OverviewofaDatabaseManagementSystem Storagemanagerandbuffermanager managesthereadingandwritingofinformationincludesthestoragemanagerandthebuffermanager storagemanager keepstrackofthelocationoffilesonthediskandobtainstheblockorblockscontainingafileonrequestfromthebuffermanager block 4K 16Kbuffermanager partitiontheavailablemainmemoryintobuffers page 1K 4K 1 2OverviewofaDatabaseManagementSystem Transaction agroupofoperationsthatmustappeartohavebeenexecutedtogethersequentially asaunit Properties ACIDAtomicity eitherallofatransactionbeexecutedornoneofitis Consistency keepconsistentstate Isolation Whentwoormoretransactionsrunconcurrently theireffectsmustbeisolatedfromoneanother Durability 持久性 Ifatransactionhascompleteditswork itseffectshouldnotgetlostwhilethesystemfail evenifitfailsimmediatelyafterthetransactioncompletes 1 2OverviewofaDatabaseManagementSystem Transactionmanager beresponsiblefortheintegrityofthesystemLoggingConcurrencycontrol lockDeadlockresolution 1 2OverviewofaDatabaseManagementSystem Client Server C S architecture DBClient DBClient DBServer JavaC C PowerBuilderDelphiVB MSAccessSybaseASAMySQLOracleIBMDB2 sqlrequest sqlrequest reply reply Client theprocesssendingqueriesorothercommands Server theprocessexecutingqueriesorothercommands 1 3OutlineofDatabase SystemsStudies Ideasrelatedtodatabasesystemcanbedividedintothreebroadcategories Design Howtobuildausefuldatabase Requirementanalysis datamodeling relationalmodeling Programming Howtoexpressqueriesandotheroperationsondatabase Iimplementation HowtobuildaDBMS 1 3 1DatabaseDesign Chapter2and3coverdesign Chapter2 TheEntity RelationshipDataModelChapter3 TheRelationalDataModel 1 3 3Example We llbuildamarketingdatabasesystemforasalecompany supermarket Itwillmanageallthefollowinginformation 1 Managealldepartments informationinthecompany suchas Shanghaisaledepartment JiangSusaledepartment Alsomanageeverysalesmaninformationinthosedepartmentsincludingexclusiveemployeenumber IDcardnumber andsomeprivateinformation suchasname gender birthdayandphonenumber Bythewayoneofsalesmenwillactasthedepartmentmanagerinhisdepartment 1 3 3Example 2 Manageagroupofcustomers name province city companyname phonenumber 3 Managealltheproducts information manufacturers e g Chunlan Hailer types e g motorcycle airconditioner specifications e g MT125 RE1500 prices descriptions 4 Managesalesorderwhichrecordeachdealhasbeendone Notes everysalesordercontainsanuniqueorderNo signdate acorrespondingcustomer asalesman andatleastonekindofproducts Anyproductintheordershouldhaveitsquantityandunitpricewhichwillbeusedtocalculatethetotalprices RelationalDataModel Customer custid name prov city phone unit Product prodid factory type spec price desc Salesman empid idno name gender phone deptid Department depti

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论