]a a î íf= áõâfé ] v = A. Silberschatz, H. Korth and S. Sudarshan, Database System Concepts (3rd Edition), The McGraw Hill Company, 1997. C. Batini, S.Ceri, and S. Navathe, Conceptual Database Design - An Entity-Relationship Approach, The Benjamin/Cummings Publishing Company, 1995. Chapter 1-1 1
E 1 Introduction 9 PowerBuilder Ñ 2 Entity-Relationship Model 10 Non Relational Database 3 Relational Model 11 Storage/File Structure 4 SQL 12 Indexing and Hashing 5 SQL ü Oracle Ñ 13 Query Processing 6 Relational Database ± 14 Transactions 7 Relational Database ± 15 ÆÉ / yâ 8 þñ ÉÅ 16 ½ ÉÅ Chapter 1-2 Chapter 1 Introduction 2
Table of Contents 1. Purpose of Database Systems 2. View of Data 3. Data Models 4. Database Languages 5. Transaction Management 6. Storage Management 7. Database Administrator 8. Database Users 9. Overall System Architecture Chapter 1-4 1. Purpose of Database Systems z á É I(Information System) ]a i í, ] EÙ ái âe É I Ñ%± ]a ]a á í ]a E Chapter 1-5 3
Ai É I½ E á Application Program 1 File 1 Application Program 2 File 2 Application Program 3 File 3 Application Program n File n Chapter 1-6 ]a a i a I á AP 1 AP 2 AP 3 AP n DBMS Database File 1 File 2 File 3 File n Chapter 1-7 4
Ai É IE Õý(1) z ]a þâ(data Redundancy) Æi EåE ]a Ñ ae uie í âñe š1 ü 1é Í 1 Æi ]a E á5 % z ]a rz(data Dependence) ) î Y]í ªa ñiå ± ª Chapter 1-8 Ai É IE Õý(2) z Integrity problems z Atomicity problems z Concurrent-access anomalies z Difficulty in accessing data i î Ai : ) î Ai = 1:1 > ñiå ½ ) î Y]i ñi N% Õá Õö > ñiå ½ ½E Ê)I¹ ]a N % í Chapter 1-9 5
]a a E E z V IyE þâ z í í E½ J ]a ]a ]az î ]a ] E v½ ÉÉ 1 I ]az â ]a Chapter 1-10 DBMS z Definition Set of programs to access the data z Goal Provide an environment that is convenient and efficient to use in retrieving from and storing into the database z Note Database Database System Database Management System Chapter 1-11 6
DBMSE 1 z E ]a ] Data Definition Language(DDL)½ Ea ½ z í ]a (m, Í, š, í) Data Manipulation Language(DML)½ Ea ½ z še, ÆÉ, ]a!, á5 Þ Data Control Language(DCL)½ Ea ½ Chapter 1-12 DBMSE ý z ]a ²ª â z ]a E â ]a þâ IyA z ]a E ií z ]a E! z ]a E á5 á z IíA z ñ îe ]a YE ù2 ü ] Chapter 1-13 7
DBMSE Õý z î1e qñé z }¹ E âža z E % Chapter 1-14 2. View of Data z Two Goals of DBMS 1. ]a í í / %m Ê -½ 2. ]a E îe í ü z Data Abstraction DBMSE uå I- í }í ½E ]a i jy m Chapter 1-15 8
Levels of Data Abstraction z Physical Level How the data is actually stored Complex low-level data structureí }%u z Conceptual Level What data are stored & relationships among data Database administrator(dba)½ Ea z View Level Describe only parts of the entire database Ñ }í á ]a a E íý Chapter 1-16 Three-level Architecture View Level View 1 View 2 View n Logical Level Physical Level Database Chapter 1-17 9
Instances and Schema z Schema : DBE Y](Õ ) Í õõyy r a éy ±yu% yé Í z Instance Éý½ DBE É (dataÿñe É) DB stateií± U :%Æ 18 íy ý 52 -Í 42 ªé 11010 :%Æ 3,000 11011 ý 10,000 12048 -Í 8,000 Chapter 1-18 Three Level Schema Subschema 1 (External Schema) Subschema n (External Schema) Logical Schema Physical Schema Database Chapter 1-19 10
Data Independence z E Ability to modify a schema in one level without affecting a schema definition in the next higher level z Physical Data Independence Physical schemae ª½ í(õ: ]a ) Application Program1 ÑÉ ~M 1 ³9 z Logical Data Independence Logical schemae ª½ í (õ: µi 1É í) Application Program1 ÑÉ ~M 1 ³9 Chapter 1-20 3. Data Models z Data Model? Conceptual tool to represent Data Data Relationship Data Semantics Data Constraint z Three Categories Object-based logical model (Conceptual Model) Record-based logical model (Logical Model) Physical data model Chapter 1-21 11
Object-Based Logical Model z E Conceptual Modeling½ éi Object-based logical model1 ½E DBMS a E 71 ± u9. z re Entity-Relationship Model Object-Oriented Model Semantic Data Model Functional Data Model Chapter 1-22 Entity-Relationship(ER) Model z Entity- Relationship)I Ñ%±i Iñ Entity: account, customer Attribute: customer-name, social-security, balance Relationship: depositor social-security customer-street customer-name customer-city account-number balance Customer Depositor Account Chapter 1-23 12
Object-Oriented Model z Object - Unit of Encapsulation Instance Variable Method Communicated via Message Passing Grouped into Class z Relationship Inheritance: IS-A Relationship Aggregation: PART-OF Relationship Chapter 1-24 Record-Based Logical Model z E ]a a E Yñ1 ÍI high-level spec. DBMS½ Ea p1 í. z re Relational Data Model Network Data Model Hierarchical Data Model Object-Oriented Data Model Object-Relational Data Model Chapter 1-25 13
Relational Data Model z Entity- Relationshipa = 9a ÉI Iñ ñ í á î)i ]a e DBMS: Oracle, SQL Server, Informix, Sybase Þ z Sample Relational Database Figure 1.3 (Page 10) Chapter 1-26 Network/Hierarchical Model z Network Data Model Entity: Set of RecordE ÉI Iñ Relationship: RecordñE linki Iñ (n : n) DBTG Codasyl Model Figure 1.4 (Page 11) z Hierarchical Data Model Entity: Set of RecordE ÉI Iñ Relationship: RecordñE linki Iñ (1 : n) IMS Figure 1.5 (Page 11) Chapter 1-27 14
Other Logical Models z Object-Oriented Data Model Object-Oriented =1 ]a a ½ Yñ õ: Persistent C++ DBMS: Versant, ObjectStore, O2 z Object-Relational Data Model Object-Oriented/Relational e1 = ½ Relational ModelE á + OO ModelE Íö SQL + Encapsulation + User-defined Function/Type Oracle 8.x, Informix US Chapter 1-28 Physical Data Model z ) î ]a a E Y] í õaée Ê í Access Path ) î í EE Mæ Þ. z Oracle 8.x½ E Physical Modeling Instance Manageri a I DB Instance E Storage Manageri a I Table Space E Schema Manageri a I Index E Chapter 1-29 15
4. Database Languages z Data Definition Language (DDL) DB schema is specified by a set of definitions. DDL Statements DDL Compiler Set of data dictionary tables Data Dictionary Metadata½ íi ái í E ùi õ: all_tables, all_users, user_catalog Þ Chapter 1-30 4. Database Languages - ±z z Data Manipulation Language (DML) Data½ íi Retrieval/Insert/Delete/Update ½ Two Categories Procedural: What data + How to get Nonprocedural: What data Query Embedded Query Language z Data Control Language (DCL) Transaction Management (Commit, Rollback) Security Management (Grant, Revoke, Give) Chapter 1-31 16
5. Transaction Management z Transaction Unit of Logical Work OSE Process =é Properties Atomicity (Commitment Protocol) Consistency (Integrity Management) Isolation (Concurrency Control) Durability (Recovery) Chapter 1-32 6. Storage Management z Role ]a a ½ í ]a - Application ProgramñE Interface â File Manager-E Interface/File ManagerE ½ z Components Disk Manager Buffer Manager Facilities for Transaction Management Data Record/Index Manager Chapter 1-33 17
7. Database Administrator (DBA) z System1 í / îe 2q1 y z DBAE ÚM Schema Definition Storage Structure and Access Method Definition Schema and Physical Organization Modification Granting of Authorization for Data Access Integrity-Constraint Specification Chapter 1-34 8. Database Users z Application Programmer Host Language/4GL Þ1 a EÙ application program ~ Computer Professional z Sophisticated User Application program³a query languagei DB access z Specialized User I DB > qi(cad, GIS)i z Naïve User a½ ~ access E user Application program1 a EÙ DB Chapter 1-35 18
[ Bñ BBÉ IBBY] Naïve users (tellers, agents ) Application Interfaces Application Programs Object Code Transaction Manager Data Files Application Programmers Application Programs Embedded DML Precompiler Query Evaluation Engine Buffer Manager File Manager Indices Sophisticated Users Query DML Compiler Statistical Data DDL Interpreter Database Administrators Database Scheme Data Dictionary Query Processor Storage Manager Users D B M S Disk Chapter 1-36 19