




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 工业自动化技术及设备
- 工作中的心理调适与减压方法
- 工业节能的途径与方法探讨
- 工业设备节能降耗的散热技术改进
- 工业风别墅设计思路分享
- 工作场所的安全管理与防护措施
- 工作报告编写技巧与方法
- 工厂设备维护与保养
- 工程设计原理与实践
- 工程经济分析与评价
- 2025年全国统一高考语文试卷(全国一卷)含答案
- 四川体彩销售员考试试题及答案
- 2025年河北省万唯中考定心卷生物(二)
- 厂区物业维修管理制度
- 泸州理综中考试题及答案
- 内镜室患者服务专员职责与流程
- 2025龙岩市上杭县蓝溪镇社区工作者考试真题
- 2025建设银行ai面试题目及最佳答案
- 养老院养老服务纠纷调解管理制度
- 潜水作业合同协议书
- 2025-2031年中国天然气勘探行业市场运行态势及投资潜力研判报告
评论
0/150
提交评论