数据库第一讲introduction_第1页
数据库第一讲introduction_第2页
数据库第一讲introduction_第3页
数据库第一讲introduction_第4页
数据库第一讲introduction_第5页
已阅读5页,还剩47页未读 继续免费阅读

下载本文档

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

文档简介

数据库原理王建民清华大学软件学院2014年/春

Lecture1Introduction2Textbooks授课时间 第1周-第16周课程教材

DatabaseSystemConcepts(6thEdition)

高等教育出版社参考教材 数据库系统概论(第3/4版), 萨师煊、王珊 高等教育出版社3Evaluation另见4TA&Others课程辅导 黄向东纪律要求 不要迟到,不要早退其它信息 清华大学网络学堂教者王建民

62781776/5BasicConceptsData-数据

Database-数据库(DB)DatabaseManagementSystem

-数据库管理系统(DBMS)DatabaseSystem-数据库系统DatabaseApplication-数据库应用6MainContentsWhyuseDatabases?DatabaseSystemsandFileSystemsWhatisaDatabase?HowtoPerformOperationsonaDatabase?WhousesDatabase?PurposesofDatabasesHowtoDeployaDatabase?ThePastandFutureofDatabases7DatabaseManagementSystemCollectionofinterrelateddataandSetofprogramstoaccessthedata

DBMSprovidesanenvironmentthatisbothconvenientandefficienttouse狭义广义SetofprogramsInterrelateddata8DatabaseApplicationsBanking,Airlines,Enterprises……DBMSDBAppDBSysDBData9Intheearlydaysdata-centricapplicationswerebuiltontopoffilesystems10Drawbacksoffilesystems1.DataredundancyandinconsistencyMultiplefileformats,duplicationofinformationindifferentfilesE.g.addressandtelephonenumbersavedin savings-accountrecord checking-accountrecord11Drawbacksoffilesystems(c1)DifficultyinaccessingdataNeedtowriteanewprogramtocarryouteachnewtaskDataisolation—multiplefilesandformatsAutoCAD,2Ddrawingtools dwgfile–binaryfileformat differentversion,differentformatMSWord,docfile12Drawbacksoffilesystems(c2)IntegrityproblemsIntegrityconstraints(e.g.accountbalance>0)epartofprogramcodeHardtoaddnewconstraintsorchangeexistingonesAtomicityofupdatesFailuresmayleavedatabaseinaninconsistentstatewithpartialupdatescarriedoutE.g.transferoffundsfromoneaccounttoanothershouldeithercompleteornothappenatall13Drawbacksoffilesystems(c3)ConcurrentaccessbymultipleusersConcurrentaccessedneededforperformanceUncontrolledconcurrentaccessescanleadtoinconsistenciesE.g.twopeoplereadingabalanceandupdatingAccountAwith$500atthesametime,onewithdraws$50,theotherwithdraws$100SecurityproblemsPasswordsAccountbalance14MainContentsWhyuseDatabases?WhatisaDatabase?DataanditsModelsHowtoPerformOperationsonaDatabase?WhousesDatabase?PurposesofDatabasesHowtoDeployaDatabase?ThePastandFutureofDatabases15DataAbstractionDBMSprovidesuserswithanabstractviewofthedataHidesthedetailsofstorageandmaintenanceSimplifytheuser’sinteractionwiththesystem16SchemasandInstancesSimilartotypesandvariablesinprogramminglanguagesSchema-模式

thelogicalstructureofthedatabase

AnalogoustotypeinformationofavariableinaprogramInstance

-实例

theactualcontentofthedatabaseataparticularpointintimeAnalogoustothevalueofavariable17SchemaInstance18LevelsofDataAbstractionAdministratorProgrammerEndUser19PhysicallevelPhysicalleveldescribeshowarecord(e.g.,customer)isstored20LogicallevelLogicalleveldescribesdatastoredindatabase,andtherelationshipsamongthedata.

typecustomer=record

name:string;

street:string;

city:integer;

end;21Viewlevelapplicationprogramshidedetailsofdatatypes,Viewscanalsohideinformation(e.g.,salary)forsecuritypurposes22DataIndependenceIngeneral,theinterfacesbetweenthevariouslevelsandcomponentsshouldbewelldefinedsothatchangesinsomepartsdonotseriouslyinfluenceothers.23PhysicalDataIndependencetheabilitytomodifythephysicalschemawithoutchangingthelogicalschemaApplicationsdependonthelogicalschema24DataModelsAcollectionoftoolsfordescribingDataDatarelationshipsDatasemanticsDataconstraintsTypicalDataModelsRelationalmodelEntity-Relationshipmodel P.P.Chen25OtherDataModelsObject-orientedmodelSemi-structureddatamodelsXMLEarlymodelsnetworkmodelhierarchicalmodel26RelationalmodelofBankingData27EntityRelationshipModelE-RmodelofrealworldEntities(objects)E.g.customers,accounts,bankbranchRelationshipsbetweenentitiesE.g.AccountA-101isheldbycustomerJohnsonRelationshipsetdepositorassociatescustomerswithaccounts28WidelyusedfordatabasedesignDatabasedesigninE-Rmodelusuallyconvertedtodesignintherelationalmodelwhichisusedforstorageandprocessing29MainContentsWhyuseDatabases?WhatisaDatabase?HowtoPerformOperationsonaDatabase?DatabaseLanguagesWhousesDatabase?PurposesofDatabasesHowtoDeployaDatabase?ThePastandFutureofDatabases30DatabaseLanguagesDatadefinitionlanguageSpecifythedatabaseschemaDatamanipulationlanguageExpressdatabasequeriesandupdates31DataDefinitionLanguageLanguagefordefiningthedatabaseschemaE.g.

createtable

account(

account-number

char(10),

balance

integer)DDLcompilergeneratesasetoftablesstoredinadatadictionaryDatadictionarycontainsmetadata(i.e.,dataaboutdata)32DataManipulationLanguageLanguageforaccessingandmanipulatingthedataorganizedbytheappropriatedatamodelDMLalsoknownasquerylanguageTwoTypesoflanguagesProcedural–userspecifieswhatdataisrequiredandhowtogetthosedataNonprocedural–userspecifieswhatdataisrequiredwithoutspecifyinghowtogetthosedata33SQLHistoryStructuredQueryLanguageSQL=DDL+DMLDevelopedinIBMatearly1970sSQLStandardSQL-86SQL-89SQL-92SQL:1999SQL:200334InteractiveSQLSQL:widelyusednon-procedurallanguageE.g.findthenameofthecustomerwithcustomer-id192-83-7465

select

customer.customer-name

from

customer

where

customer.customer-id=‘192-83-7465’35EmbeddedSQLApplicationprogramsgenerallyaccessdatabasesthroughoneofLanguageextensionstoallowembeddedSQLC/Java/Cobol…Applicationprograminterface(e.g.ODBC/JDBC)whichallowSQLqueriestobesenttoadatabase36MainContentsWhyuseDatabases?WhatisaDatabase?HowtoPerformOperationsonaDatabase?WhousesDatabase?DatabaseUsersandAdministratorsPurposesofDatabasesHowtoDeployaDatabase?ThePastandFutureofDatabases37DatabaseUsers

UsersaredifferentiatedbythewaytheyexpecttointeractwiththesystemApplicationprogrammers

–interactwithsystemthroughDMLcallsSophisticatedusers

–formrequestsinadatabasequerylanguage38DatabaseUsers(c1)Specializedusers

–writespecializeddatabaseapplicationsthatdonotfitintothetraditionaldataprocessingframeworkNaïveusers

–invokeoneofthepermanentapplicationprogramsthathavebeenwrittenpreviouslyE.g.peopleaccessingdatabaseovertheweb,banktellers,clericalstaff39DatabaseAdministratorCentralcontrolofboththedataandtheprogramsCoordinatesalltheactivitiesofthedatabasesystemthedatabaseadministratorhasagoodunderstandingoftheenterprise’sinformationresourcesandneeds40DatabaseAdministrator’sDutiesDatabaseadministrator'sdutiesinclude:SchemadefinitionStoragestructureandaccessmethoddefinitionSchemaandphysicalorganizationmodificationGrantinguserauthoritytoaccessthedatabaseRoutinemaintenanceBackupthedatabaseEnsureenoughfreediskspaceEnsurethedatabaseperformance41MainContentsWhyuseDatabases?WhatisaDatabase?HowtoPerformOperationsonaDatabase?WhousesDatabase?PurposesofDatabasesTransactionManagementHowtoDeployaDatabase?ThePastandFutureofDatabases42PurposesofDBMSLarge-ScaleDataStorageandSearchConcurrencyControlwhenmulti-useraccessingthedatabaseRecoverywhenthesystemcrashedAccessControltopreventillegaldataaccess43TransactionManagement AtransactionisacollectionofoperationsthatperformsasinglelogicalfunctioninadatabaseapplicationACIDfeaturesAtomicity 原子性Consistency 一致性Isolation 隔离性Durability 持久性44MainContentsWhyuseDatabases?WhatisaDatabase?HowtoPerformOperationsonaDatabase?WhousesDatabase?PurposesofDatabasesHowtoDeployaDatabase?OverallSystemStructureThePastandFutureofDatabases45OverallSystemStructure46StorageManagementStoragemanagerisaprogrammodulethatprovidestheinterfacebetweenthelow-leveldatastoredinthedatabaseandtheapplicationprogramsandqueriessubmittedtothesystemThestoragemanagerisresponsibletothefollowingtasks:interactionwiththefilemanagerefficientstoring,retrievingandupdatingofdata47QueryProcessorDDLinterpreterInterpretsDDLsta

温馨提示

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

评论

0/150

提交评论