數(shù)據(jù)庫(kù)Chap 1._第1頁(yè)
數(shù)據(jù)庫(kù)Chap 1._第2頁(yè)
數(shù)據(jù)庫(kù)Chap 1._第3頁(yè)
數(shù)據(jù)庫(kù)Chap 1._第4頁(yè)
數(shù)據(jù)庫(kù)Chap 1._第5頁(yè)
已閱讀5頁(yè),還剩26頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、Silberschatz, Korth and Sudarshan1.1 nText Book lDatabase System Concepts, Fifth Edition l數(shù)據(jù)庫(kù)系統(tǒng)概念,第五版 nLecturer l俞凱 (Yu Kai) lEmail: lAffiliation: Room 404, Building 4 nPerformance l平時(shí)10% l實(shí)驗(yàn)30% l期中15% l期末45% Database System Concepts, 5th Ed. Silberschatz, Korth and Sudarshan See www.db- for conditi

2、ons on re-use Silberschatz, Korth and Sudarshan1.3 nDatabase-System Applications nPurpose of Database Systems nView of Data(數(shù)據(jù)視圖) nDatabase Languages nRelational Databases nDatabase Design nObject-based and Semistructured(半結(jié)構(gòu)化) Databases nData Storage and Querying nTransaction(事務(wù)) Management nDataba

3、se Architecture nDatabase Users and Administrators nOverall Structure nHistory of Database Systems Silberschatz, Korth and Sudarshan1.4 nDatabase Management System (DBMS) contains information about a particular enterprise lCollection of interrelated data lSet of programs to access the data lAn envir

4、onment that is both convenient and efficient to use nDatabase Applications: lBanking: all transactions lAirlines: reservations, schedules lUniversities: registration, grades lSales: customers, products, purchases lOnline retailers: order tracking, customized recommendations lManufacturing: productio

5、n, inventory, orders, supply chain lHuman resources: employee records, salaries, tax deductions nDatabases touch all aspects of our lives Silberschatz, Korth and Sudarshan1.5 nIn the early days, database applications were built directly on top of file systems nDrawbacks of using file systems to stor

6、e data: lData redundancy(冗余) and inconsistency 4Multiple file formats, duplication of information in different files lDifficulty in accessing data 4Need to write a new program to carry out each new task lData isolation multiple files and formats lIntegrity(完整性) problems 4Integrity constraints (e.g.

7、account balance 0) become “buried” in program code rather than being stated explicitly 4Hard to add new constraints or change existing ones Silberschatz, Korth and Sudarshan1.6 nDrawbacks of using file systems (cont.) lAtomicity of updates 4Failures may leave database in an inconsistent state with p

8、artial updates carried out 4Example: Transfer of funds from one account to another should either complete or not happen at all lConcurrent access by multiple users 4Concurrent accessed needed for performance 4Uncontrolled concurrent accesses can lead to inconsistencies Example: Two people reading a

9、balance and updating it at the same time lSecurity problems 4Hard to provide user access to some, but not all, data nDatabase systems offer solutions to all the above problems Silberschatz, Korth and Sudarshan1.7 nPhysical level: describes how a record (e.g., customer) is stored. nLogical level: des

10、cribes data stored in database, and the relationships among the data. type customer = record customer_id : string; customer_name : string; customer_street : string; customer_city : integer; end; nView level: application programs hide details of data types. Views can also hide information (such as an

11、 employees salary) for security purposes. Silberschatz, Korth and Sudarshan1.8 The three levels of data abstraction. Silberschatz, Korth and Sudarshan1.9 nSimilar to variables and types in programming languages nSchema(模式)(模式) the logical structure of the database lExample: The database consists of

12、information about a set of customers and accounts and the relationship between them) lAnalogous to type information of a variable in a program lPhysical schema: database design at the physical level lLogical schema: database design at the logical level nInstance the actual content of the database at

13、 a particular point in time lAnalogous to the value of a variable nPhysical Data Independence the ability to modify the physical schema without changing the logical schema lApplications depend on the logical schema lIn general, the interfaces between the various levels and components should be well

14、defined so that changes in some parts do not seriously influence others. Silberschatz, Korth and Sudarshan1.10 nA collection of tools for describing lData lData relationships lData semantics(語(yǔ)義) lData constraints nRelational model nEntity-Relationship data model (mainly for database design) nObject-

15、based data models (Object-oriented and Object-relational) nSemistructured data model (XML) nOther older models: lNetwork model lHierarchical model Silberschatz, Korth and Sudarshan1.11 nLanguage for accessing and manipulating the data organized by the appropriate data model lDML also known as query

16、language nTwo classes of languages lProcedural user specifies what data is required and how to get those data lDeclarative (nonprocedural) user specifies what data is required without specifying how to get those data nSQL is the most widely used query language Silberschatz, Korth and Sudarshan1.12 n

17、Specification notation for defining the database schema Example:create table account ( account-number char(10), balance integer) nDDL compiler generates a set of tables stored in a data dictionary nData dictionary contains metadata (i.e., data about data) lDatabase schema lData storage and definitio

18、n language 4Specifies the storage structure and access methods used lIntegrity constraints 4Domain constraints域約束 4Referential integrity (references constraint in SQL)參照完整性 4Assertions(斷言) lAuthorization(授權(quán)) Silberschatz, Korth and Sudarshan1.13 nExample of tabular data in the relational model Attri

19、butes Silberschatz, Korth and Sudarshan1.14 Silberschatz, Korth and Sudarshan1.15 nSQL: widely used non-procedural language lExample: Find the name of the customer with customer-id 192-83-7465 selectcustomer.customer_name fromcustomer wherecustomer.customer_id = 192-83-7465 lExample: Find the balanc

20、es of all accounts held by the customer with customer-id 192-83-7465 selectaccount.balance from depositor, account where depositor.customer_id = 192-83-7465 and depositor.account_number = account.account_number nApplication programs generally access databases through one of lLanguage extensions to a

21、llow embedded SQL lApplication program interface (e.g., ODBC/JDBC) which allow SQL queries to be sent to a database Silberschatz, Korth and Sudarshan1.16 The process of designing the general structure of the database: nLogical Design Deciding on the database schema. Database design requires that we

22、find a “good” collection of relation schemas. lBusiness decision What attributes should we record in the database? lComputer Science decision What relation schemas should we have and how should the attributes be distributed among the various relation schemas? nPhysical Design Deciding on the physica

23、l layout of the database Silberschatz, Korth and Sudarshan1.17 nModels an enterprise as a collection of entities and relationships lEntity: a “thing” or “object” in the enterprise that is distinguishable from other objects 4Described by a set of attributes lRelationship: an association among several

24、 entities nRepresented diagrammatically by an entity-relationship diagram: Silberschatz, Korth and Sudarshan1.18 nExtend the relational data model by including object orientation and constructs to deal with added data types. nAllow attributes of tuples to have complex types, including non-atomic val

25、ues such as nested relations. nPreserve relational foundations, in particular the declarative access to data, while extending modeling power. nProvide upward compatibility with existing relational languages. Silberschatz, Korth and Sudarshan1.19 nSemistructured data models permit the specification o

26、f data where individual data items of the same type may have different sets of attributes. nFor example, XML (Extensible Markup Language) originally intended as a way of adding markup information to text documents. nThe ability to specify new tags, and to create nested tag structures made XML a grea

27、t way to exchange data. nXML has become the basis for all new generation data interchange formats. nA wide variety of tools is available for parsing, browsing and querying XML documents/data Silberschatz, Korth and Sudarshan1.20 nStorage manager is a program module that provides the interface betwee

28、n the low-level data stored in the database and the application programs and queries submitted to the system. nThe storage manager is responsible to the following tasks: lTranslate various DML statements into low-level file-system commands lEfficient storing, retrieving and updating data in the data

29、base nStorage manager components: lAuthorization and integrity manager lTransaction manager lFile manager lBuffer manager nStorage manager implements several data structures: lData files lData dictionary lIndices Silberschatz, Korth and Sudarshan1.21 nQuery processor components: lDDL interpreter(解釋器

30、) lDML compiler lQuery evaluation engine 關(guān)系代數(shù)表達(dá)式 Silberschatz, Korth and Sudarshan1.22 nA transaction is a collection of operations that performs a single logical function in a database application nEach transaction is a unit of both atomicity and consistency. nTransaction-management component(事務(wù)管理部

31、件)(事務(wù)管理部件) ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures. nConcurrency-control manager(并發(fā)控制器)(并發(fā)控制器) controls the interaction among the concurrent transactions, to ensure the cons

32、istency of the database. Silberschatz, Korth and Sudarshan1.23 nData mining attempts to discover rules and patterns from data. nData mining differs from machine learning and statistics in that it deals with large volumes of data, stored primarily on disk. nQuerying of unstructured textual data is re

33、ferred to as information retrieval. Silberschatz, Korth and Sudarshan1.24 The architecture of a database systems is greatly influenced by the underlying computer system on which the database is running: nCentralized nClient-server nParallel nDistributed Silberschatz, Korth and Sudarshan1.25 Silbersc

34、hatz, Korth and Sudarshan1.26 Users are differentiated by the way they expect to interact with the system nNaive users unsophisticated users who interact with the system by invoking one of the application programs that have been written previously lExamples, people accessing database over the web, b

35、ank tellers, etc. nApplication programmers computer professionals who write those application programs. nSophisticated users interact with the system without writing programs and form requests in a database query language nSpecialized users write specialized database applications that do not fit into the traditional data processing framework Silberschatz, Korth and Sudarshan1.27 nA person who has such central control over the system is called a database administrator (DBA). nDBAs duties include: lSchema definition lStorage structure and access method defini

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論