数据库系统英文课件:ch01 Introduction_第1页
数据库系统英文课件:ch01 Introduction_第2页
数据库系统英文课件:ch01 Introduction_第3页
数据库系统英文课件:ch01 Introduction_第4页
数据库系统英文课件:ch01 Introduction_第5页
已阅读5页,还剩26页未读 继续免费阅读

下载本文档

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

文档简介

1、Chapter 1: Introduction1Chapter 1: IntroductionPurpose of Database SystemsView of DataDatabase LanguagesRelational DatabasesDatabase DesignObject-based and semistructured databasesData Storage and QueryingTransaction ManagementDatabase ArchitectureDatabase Users and AdministratorsOverall StructureHi

2、story of Database Systems2Database Management System (DBMS)DBMS contains information about a particular enterpriseCollection of interrelated dataSet of programs to access the data An environment that is both convenient and efficient to useDatabase Applications:Banking: all transactionsAirlines: rese

3、rvations, schedulesUniversities: registration, gradesSales: customers, products, purchasesOnline retailers: order tracking, customized recommendationsManufacturing: production, inventory, orders, supply chainHuman resources: employee records, salaries, tax deductionsDatabases touch all aspects of ou

4、r lives3Purpose of Database SystemsIn the early days, database applications were built directly on top of file systemsDrawbacks of using file systems to store data:Data redundancy and inconsistencyMultiple file formats, duplication of information in different filesDifficulty in accessing data Need t

5、o write a new program to carry out each new taskData isolation multiple files and formats, difficult to retrieve theappropriate data.Integrity problemsIntegrity constraints (e.g. account balance 0) become “buried” in program code rather than being stated explicitlyHard to add new constraints or chan

6、ge existing ones4Purpose of Database Systems (Cont.)Drawbacks of using file systems (cont.) Atomicity of updatesFailures may leave database in an inconsistent state with partial updates carried outExample: Transfer of funds from one account to another should either complete or not happen at allConcu

7、rrent access by multiple usersConcurrent accessed needed for performanceUncontrolled concurrent accesses can lead to inconsistenciesExample: Two people reading a balance and updating it at the same timeSecurity problemsHard to provide user access to some, but not all, dataDatabase systems offer solu

8、tions to all the above problems5Levels of AbstractionPhysical level: describes how a record (e.g., customer) is stored.Logical level: describes data stored in database, and the relationships among the data.type customer = recordcustomer_id : string; customer_name : string;customer_street : string;cu

9、stomer_city : integer;end;View level: application programs hide details of data types. Views can also hide information (such as an employees salary) for security purposes. 6View of DataAn architecture for a database system 7Instances and SchemasSimilar to types and variables in programming languages

10、Schema 模式 the logical structure of the database Example: The database consists of information about a set of customers and accounts and the relationship between them.Analogous to type information of a variable in a programPhysical schema: database design at the physical levelLogical schema: database

11、 design at the logical levelInstance the actual content of the database at a particular point in time Analogous to the value of a variablePhysical Data Independence the ability to modify the physical schema without changing the logical schema (especially, application programs)Applications depend on

12、the logical schemaIn general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others.8Data ModelsA collection of tools for describing Data Data relationshipsData semanticsData constraintsRelational modelEntity-R

13、elationship data model (mainly for database design) Object-based data models (Object-oriented and Object-relational)Semistructured data model (XML)Other older models: used littleNetwork model Hierarchical model9Data Manipulation Language (DML)Language for accessing and manipulating the data organize

14、d by the appropriate data modelDML also known as query languageTwo classes of languages Procedural user specifies what data is required and how to get those data Declarative (nonprocedural) user specifies what data is required without specifying how to get those dataSQL is the most widely used query

15、 language10Data Definition Language (DDL)Specification notation for defining the database schemaExample:create table account ( account-number char(10), balance integer)DDL compiler generates a set of tables stored in a data dictionaryData dictionary contains metadata (i.e., data about data)Database

16、schema Data storage and definition language Specifies the storage structure and access methods usedIntegrity constraintsDomain constraintsReferential integrity (references constraint in SQL)AssertionsAuthorization 授权11Relational ModelExample of tabular data in the relational modelAttributes12A Sampl

17、e Relational Database13SQLSQL: widely used non-procedural languageExample: Find the name of the customer with customer-id 192-83-7465selectcustomer.customer_namefromcustomerwherecustomer.customer_id = 192-83-7465Example: Find the balances of all accounts held by the customer with customer-id 192-83-

18、7465selectaccount.balancefrom depositor, accountwhere depositor.customer_id = 192-83-7465 anddepositor.account_number = account.account_numberApplication programs generally access databases through one ofLanguage extensions to allow embedded SQLApplication program interface (e.g., ODBC/JDBC) which a

19、llow SQL queries to be sent to a database14Database DesignThe process of designing the general structure of the database:Logical Design Deciding on the database schema. Database design requires that we find a “good” collection of relation schemas.Business decision What attributes should we record in

20、 the database?Computer Science decision how to group these attributes to form the various tables?Physical Design Deciding on the physical layout of the database 15The Entity-Relationship ModelModels an enterprise as a collection of entities and relationshipsEntity: a “thing” or “object” in the enter

21、prise that is distinguishable from other objectsDescribed by a set of attributesRelationship: an association among several entitiesRepresented diagrammatically by an entity-relationship diagram:16Object-Relational Data ModelsExtend the relational data model by including object orientation and constr

22、ucts to deal with added data types.Allow attributes of tuples to have complex types, including non-atomic values such as nested relations.Preserve relational foundations, in particular the declarative access to data, while extending modeling power.Provide upward compatibility with existing relationa

23、l languages.17Semistructured Database Mode : Extensible Markup LanguageDefined by the WWW Consortium (W3C)Originally intended as a document markup language not a database languageThe ability to specify new tags, and to create nested tag structures made XML a great way to exchange data, not just docu

24、mentsXML has become the basis for all new generation data interchange formats.A wide variety of tools is available for parsing, browsing and querying XML documents/data18Storage ManagementStorage manager is a program module that provides the interface between the low-level data stored in the databas

25、e and the application programs and queries submitted to the system.The storage manager is responsible to the following tasks: Interaction with the file manager Efficient storing, retrieving and updating of dataIssues:Storage accessFile organizationIndexing and hashing19Query Processing1.Parsing and

26、translation2.Optimization3.Evaluation20Query Processing (Cont.)Alternative ways of evaluating a given queryEquivalent expressionsDifferent algorithms for each operationCost difference between a good and a bad way of evaluating a query can be enormousNeed to estimate the cost of operationsDepends cri

27、tically on statistical information about relations which the database must maintainNeed to estimate statistics for intermediate results to compute cost of complex expressions21Transaction ManagementA transaction is a collection of operations that performs a single logical function in a database appl

28、icationTransaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures.Concurrency-control manager controls the interaction among the concurrent transactions, to en

29、sure the consistency of the database. 22Database ArchitectureThe architecture of a database systems is greatly influenced by the underlying computer system on which the database is running:CentralizedClient-serverParallel (multi-processor)Distributed 23Database UsersUsers are differentiated by the w

30、ay they expect to interact with the systemApplication programmers interact with system through DML callsSophisticated users 经验用户 form requests in a database query languageSpecialized users 专业用户 write specialized database applications that do not fit into the traditional data processing frameworkNave

31、 users 无经验用户 invoke one of the permanent application programs that have been written previouslyExamples, people accessing database over the web, bank tellers, clerical staff24Database AdministratorCoordinates all the activities of the database system; the database administrator has a good understanding of the enterprises information resources and needs.Database administrators duties include:Schema definitionStorage structure and access method definitionSchema and physical organization modificationGranting user authority to access the databas

温馨提示

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

评论

0/150

提交评论