Departmentofcomputerscience&technologyNJUSTDatabaseSystems数据库系统DatabaseSystems2.5学分上课、0.5学分上机,共3学分。学习目的:掌握数据库系统的基本概念、原理和方法;学会有效地使用数据库管理系统,完成数据库的设计和对数据库的编程。学习方法:理论结合实践。考核方式及要求:–作业(20%):按时认真完成作业。–实验(10%):完成上机实验并提交实验报告。–闭卷考试(70%):英文试卷。DatabaseSystemsReferencebooks–JeffreyD.Ullman,JenniferWidom.数据库系统基础教程(原书第3版).岳丽华等译.机械工业出版社.2009.–AbrahamSilberschatz,HenryF.Korth,S.Sudarshan.DatabaseSystemConcepts(FourthEdition).机械工业出版社.–~ullman/fcdb.html1.TheWorldsofDatabaseSystem2.TheRelationalModelofData3.*DesignTheoryforRelationalDatabases4.High-LevelDatabaseModels5.AlgebraicandLogicalQueryLanguage6.*TheDatabaseLanguageSQL7.ConstraintsandTriggers8.ViewsandIndexes9.SQLinaServerEnvironment10.AdvancedtopicsinRelationalDatabasesAFirstCourseinDatabaseSystems1TheWorldsofDatabaseSystemsTheEvolutionofDatabaseSystemsOverviewofaDBMSOutlineofDatabase-SystemStudies1.1TheEvolutionofDatabaseSystemsWhat’sadatabase?–Inessence,adatabaseisacollectionofinformationthatexistsoveralongperiodoftime,oftenmanyyears.–Incommonparlance(说法),adatabaseisacollectionofdatathatismanagedbyadatabasemanagementsystem(DBMS).1.1TheEvolutionofDatabaseSystemsDatabaseApplications:–Banking:alltransactions(交易)–Airlines:reservations(预定),schedules(航班表)–Universities:registration,grades–Sales:customers,products,orders–Manufacturing:production,inventory(库存),orders,supplychain–Humanresources:employeerecords,salaries,taxdeductionsDatabasestouchallaspectsofourlives.1.1TheEvolutionofDatabaseSystemsADBMSisexpectedto:–DataDefinitionLanguage(DDL):createdatabasesandspecifytheirschema(模式).AschemaisagroupofcollectionsofsentencesthatareexpressedbyDDLtodescribethelogicalstructureofthedatabasecompletely.–DataQueryLanguageandDataManipulationLanguage:query(查询)andmodify(更新)thedatabasedontheschemaofthedatabase.–Supportthestorageofverylargeamountsofdata:manyterabytes(1012bytes)ormore,overalongperiodoftime,allowingefficientaccess.1.1TheEvolutionofDatabaseSystemsADBMSisexpectedto:–Enabledurability(持久):therecoveryofthedatabaseinthefaceoffailures(故障),errorsofmanykinds,orintentionalmisuse.–SupportDatasharing(共享):controlaccesstodatafrommanyusersatonce;withoutallowingtheactionofoneusertoaffectotherusers(isolation隔离性);withoutactionsonthedatatobeperformedpartiallybutnotcompletely(atomicity原子性).1.1TheEvolutionofDatabaseSystemsDatabasesystemsevolvedfromfilesystems.–Dataredundancy(冗余)andinconsistencyMultiplefileformats,duplicationofinformationindifferentfiles.–DifficultyinaccessingdataNeedtowriteanewprogramtocarryouteachnewtask.1.1TheEvolutionofDatabaseSystemsDatabasesystemsevolvedfromfilesystems.–Integrity(完整性)problemsIntegrityconstraints(约束)(e.g.accountbalance0)become“buried(埋入)”inprogramcoderatherthanbeingstatedexplicitly(明确地).Hardtoaddnewconstraintsorchangeexistingones.–AtomicityofupdatesFailures(故障)mayleavedatabaseinaninconsistentstatewithpartialupdatescarriedout.Example:Transferoffunds(资金)fromoneaccounttoanothershouldeithercompleteornothappenatall.1.1TheEvolutionofDatabaseSystemsDatabasesystemsevolvedfromfilesystems.–Concurrent(并发)accessbymultipleusersUncontrolledconcurrentaccessescanleadtoinconsistencies.Example:Twopeoplereadingabalanceandupdatingitatthesametime.–SecurityproblemsHardtoprovideuseraccesstosome,butnotall,data.1.1TheEvolutionofDatabaseSystemsLate1960sand1970s:–Harddisksallowdirectaccesstodata–Networkandhierarchicaldatamodelsinwidespreaduse–TheearlyDBMSdidn'tsupporthigh-levelquerylanguages.1.1TheEvolutionofDatabaseSystems1970:–TedCodddefinestherelationaldatamodelReceivedtheACMTuringAwardin1981IBMResearchbeginsSystemRprototype–Mainidea:organizeallthedataindatabaseastablescalledrelations.–Queriescouldbeexpressedinaveryhigh-levellanguagetoincreasetheefficiencyofdatabaseprogrammers.1.1TheEvolutionofDatabaseSystems1980s:–Researchrelationalprototypesevolveintocommercial(商用的)systemsSQLbecomesindustrialstandard–Parallelanddistributed(分布式)databasesystems–Object-orienteddatabasesystems1990s:–Largedecisionsupportanddata-mining(数据挖掘)applications–Largemulti-terabytedatawarehouses(数据仓库)–Emergence(出现)ofWebcommerce(商务)2000s:–XML(可扩展模型语言)andXQuerystandards1.2OverviewofaDatabaseManagementSystemADBMSisapowerfultoolforcreatingandmanaginglargeamountsofdataefficientlyandallowingittopersistoverlongperiodsoftime,safely.1.2OverviewofaDatabaseManagementSystem1.2OverviewofaDatabaseManagementSystemApplication1Application2...ApplicationnDBMSdatabaseDatabaseManagementSystemread/writepagesStoragemanagerStorageindex,file,andrecordrequestsindex/file/recordmangerDDLcommandsQueries,updatesQuerycompilerUser/applicationDDLcompilerDatabaseadministratorLocktableLoggingandrecoveryConcurrencycontrollogpagespagecommandsBuffermanagerbuffersdata,metadata,indexsmetadataQueryplanExecutionengineMetadata,statistics单线框系统成分双线框内存中的数据结构实线控制和数据流虚线数据流TransactionmanagerTransactioncommands1.2OverviewofaDatabaseManagementSystemTwotypesofuser:–Conventionalusersandapplicationprograms.–Adatabaseadministrator(DBA):apersonorpersonsresponsibleforthestructureorschemaofthedatabase.Thre