




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
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)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 3-12競爭和冒險1-邏輯冒險的判斷
- 山東省名校聯(lián)盟2024?2025學年高一下學期3月校際聯(lián)考 數(shù)學試題(含解析)
- 右江民族醫(yī)學院《有機化學B》2023-2024學年第二學期期末試卷
- 瀟湘職業(yè)學院《建筑工程質(zhì)量與安全》2023-2024學年第二學期期末試卷
- 南昌大學科學技術(shù)學院《工程項目與質(zhì)量管理》2023-2024學年第二學期期末試卷
- 陜西省西安市交大附中2024-2025學年第二學期十二月份月考英語試題含答案
- 濮陽科技職業(yè)學院《西方文學(上)》2023-2024學年第二學期期末試卷
- 廈門大學嘉庚學院《現(xiàn)代科學與工程計算(二)》2023-2024學年第二學期期末試卷
- 山西晉中理工學院《藥用動物學實驗》2023-2024學年第二學期期末試卷
- 上海嘉定區(qū)2025年高三零診綜合試題含解析
- 《智能系統(tǒng)》第7章 自主無人系統(tǒng)
- 樹木栽植檢查記錄表
- 百勝MYLAB-TWICE-彩超參數(shù)
- Q∕SY 1670.1-2014 投產(chǎn)方案編制導則 第1部分:原油、成品油管道
- WS377.4-2013 婦女保健基本數(shù)據(jù)集 第4部分:孕產(chǎn)期保健服務(wù)與高危管理
- 刺激性氣體中毒課件
- 作文素材----片段式作文
- 巧用Mapinfo軟件SQL查詢功能--肖2017
- ID2016 200V三相驅(qū)動芯片-電荷泵mos管驅(qū)動芯片-驪微電子
- 家具廠首件檢驗記錄表
- 凝汽器灌水查漏方案及措施
評論
0/150
提交評論