版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、Chapter 1: Introduction Database 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: transactionsAirlines: reservatio
2、ns, schedulesUniversities: registration, gradesSales: customers, products, purchasesOnline retailers: order tracking, customized recommendationsManufacturing: production, inventory, orders, supply chainHuman resources: employee records, salaries, tax deductionsDatabases can be very large.Databases t
3、ouch all aspects of our livesUniversity Database ExampleApplication program examplesAdd new students, instructors, and coursesRegister students for courses, and generate class rostersAssign grades to students, compute grade point averages (GPA) and generate transcriptsIn the early days, database app
4、lications were built directly on top of file systemsDrawbacks of using file systems to store dataData redundancy and inconsistencyMultiple file formats, duplication of information in different filesDifficulty in accessing data Need to write a new program to carry out each new taskData isolation mult
5、iple files and formatsIntegrity problemsIntegrity constraints (e.g., account balance 0) become “buried” in program code rather than being stated explicitlyHard to add new constraints or change existing onesDrawbacks of using file systems to store data (Cont.)Atomicity of updatesFailures may leave da
6、tabase in an inconsistent state with partial updates carried outExample: Transfer of funds from one account to another should either complete or not happen at allConcurrent access by multiple usersConcurrent access needed for performanceUncontrolled concurrent accesses can lead to inconsistenciesExa
7、mple: Two people reading a balance (say 100) and updating it by withdrawing money (say 50 each) at the same timeSecurity problemsHard to provide user access to some, but not all, dataDatabase systems offer solutions to all the above problemsLevels of AbstractionPhysical level: describes how a record
8、 (e.g., customer) is stored.Logical level: describes data stored in database, and the relationships among the data.type instructor = recordID : string; name : string;dept_name : string;salary : integer;end;View level: application programs hide details of data types. Views can also hide information (
9、such as an employees salary) for security purposes. View of DataAn architecture for a database system Instances and SchemasSimilar to types and variables in programming languagesSchema the logical structure of the database Example: The database consists of information about a set of customers and ac
10、counts and the relationship between themAnalogous to type information of a variable in a programPhysical schema: database design at the physical levelLogical schema: database design at the logical levelInstance the actual content of the database at a particular point in time Analogous to the value o
11、f a variablePhysical Data Independence the ability to modify the physical schema without changing the logical schemaApplications depend on 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 infl
12、uence others.Data ModelsA collection of tools for describing Data Data relationshipsData semanticsData constraintsRelational modelEntity-Relationship data model (mainly for database design) Object-based data models (Object-oriented and Object-relational)Semistructured data model (XML)Other older mod
13、els:Network model Hierarchical modelRelational ModelRelational model (Chapter 2)Example of tabular data in the relational modelColumnsRowsA Sample Relational DatabaseData Manipulation Language (DML)Language for accessing and manipulating the data organized by the appropriate data modelDML also known
14、 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 languageData Definition Language (DDL)Specif
15、ication notation for defining the database schemaExample:create table instructor ( ID char(5), name varchar(20), dept_name varchar(20), salary numeric(8,2)DDL compiler generates a set of table templates stored in a data dictionaryData dictionary contains metadata (i.e., data about data)Database sche
16、ma Integrity constraintsPrimary key (ID uniquely identifies instructors)Referential integrity (references constraint in SQL)e.g. dept_name value in any instructor tuple must appear in department relationAuthorizationSQLSQL: widely used non-procedural languageExample: Find the name of the instructor
17、with ID 22222selectnamefrominstructorwhereinstructor.ID = 22222Example: Find the ID and building of instructors in the Physics dept. select instructor.ID, department.buildingfrom instructor, departmentwhere instructor.dept_name = department.dept_name and department.dept_name = Physics Application pr
18、ograms generally access databases through one ofLanguage extensions to allow embedded SQLApplication program interface (e.g., ODBC/JDBC) which allow SQL queries to be sent to a databaseChapters 3, 4 and 5Database DesignThe process of designing the general structure of the database:Logical Design Dec
19、iding on the database schema. Database design requires that we find a “good” collection of relation schemas.Business decision What attributes should we record in the database?Computer Science decision What relation schemas should we have and how should the attributes be distributed among the various
20、 relation schemas?Physical Design Deciding on the physical layout of the database Database Design?Is there any problem with this design?Design ApproachesNormalization Theory (Chapter 8)Formalize what designs are bad, and test for themEntity Relationship Model (Chapter 7)Models an enterprise as a col
21、lection of entities and relationshipsEntity: a “thing” or “object” in the enterprise that is distinguishable from other objectsDescribed by a set of attributesRelationship: an association among several entitiesRepresented diagrammatically by an entity-relationship diagram:The Entity-Relationship Mod
22、elModels an enterprise as a collection of entities and relationshipsEntity: a “thing” or “object” in the enterprise that is distinguishable from other objectsDescribed by a set of attributesRelationship: an association among several entitiesRepresented diagrammatically by an entity-relationship diag
23、ram:What happened to dept_name of instructor and student?Object-Relational Data ModelsRelational model: flat, “atomic” valuesObject Relational Data ModelsExtend the relational data model by including object orientation and constructs to deal with added data types.Allow attributes of tuples to have c
24、omplex 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 relational languages.XML: Extensible Markup LanguageDefined by the WWW Consortiu
25、m (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 documentsXML has become the basis for all new generation data interchange formats.A wide variety of too
26、ls is available for parsing, browsing and querying XML documents/dataStorage ManagementStorage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system.The storage manager is responsible
27、 to the following tasks: Interaction with the file manager Efficient storing, retrieving and updating of dataIssues:Storage accessFile organizationIndexing and hashingQuery Processing1.Parsing and translation2.Optimization3.EvaluationQuery Processing (Cont.)Alternative ways of evaluating a given que
28、ryEquivalent 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 critically on statistical information about relations which the database must maintainNeed to estimate stati
29、stics for intermediate results to compute cost of complex expressionsTransaction ManagementWhat if the system fails?What if more than one user is concurrently updating the same data?A transaction is a collection of operations that performs a single logical function in a database applicationTransacti
30、on-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 ensure the consistency of the database. Database Users and AdministratorsDatabaseDatabase System InternalsDatabase ArchitectureThe architecture of a database systems is greatly influenced by the underlying computer system on which the database is running:CentralizedClient
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 廣告營銷合同范本
- 車輛押借款合同
- 網簽版建筑工程合同模板
- 知識產權(TPR)保護框架協(xié)議
- 2024年有關藏品的協(xié)議書范本
- 大學生靈活就業(yè)協(xié)議書范本
- 工業(yè)用途商品購買合同
- 房地產租賃合同范本合輯
- 技術服務合作協(xié)議書范本
- 2024年貨架采購合同
- 電子鼻咽喉鏡檢查及相關知識ppt課件
- 漆包線檢驗方法介紹
- 工商管理論文提綱模板
- 餐廚廢棄物處置登記表
- 雕塑施工方案
- 80T水泥罐安裝方案9.18
- 社區(qū)委員的辭職報告 社區(qū)兩委辭職報告
- 簡歷常用icon圖標Word簡歷模板
- 社區(qū)老年人群保健與護理PPT課件
- 【行業(yè)】電動車動力電池包高清大圖賞析
- F1等級砝碼標準報告
評論
0/150
提交評論