亚伯拉罕·西尔伯沙茨 (Abraham Silberschatz) 于纽约州立大学石溪分校获得博士学位,现为耶鲁大学计算机科学系Sidney J. Weinberg教授,曾任贝尔实验室信息科学研究中心副主任。他是ACM会士、IEEE 会士以及康涅狄格科学与工程学会的成员,获得了48项专利和24项授权。他还是教科书《操作系统概念》的作者。 亨利·F. 科思 (Henry F. Korth) 于普林斯顿大学获得博士学位,现为理海大学计算机科学与工程系教授和计算机科学与商业项目联合主任,曾任贝尔实验室数据库原理研究中心主任、松下科技副总裁、得克萨斯大学奥斯汀分校副教授以及IBM研究中心研究人员。他是ACM会士、IEEE会士以及VLDB会议10年贡献奖的获得者。他的研究涉及数据库系统的方方面面,最近,他的研究致力于解决区块链在企业数据库中的应用问题。 S. 苏达尔尚 (S. Sudarshan) 于威斯康星大学获得博士学位,现为印度理工学院孟买校区Subrao M. Nilekani讲席教授,曾为贝尔实验室技术人员。他是ACM会士,发表了100余篇论文并获得15项专利。他目前的研究领域包括SQL查询的测试和分级、通过重写命令式代码来优化数据库应用程序,以及并行数据库的查询优化。
章节目录
Chapter 1 Introduction 1<br/>1.1 Database-System Applications1<br/>1.2 Purpose of Database Systems5<br/>1.3 View of Data8<br/>1.3.1 Data Models8<br/>1.3.2 Relational Data Model9<br/>1.3.3 Data Abstraction9<br/>1.3.4 Instances and Schemas12<br/>1.4 Database Languages 13<br/>1.4.1 Data-Definition Language 13<br/>1.4.2 The SQL Data-Definition Language 14<br/>1.4.3 Data-Manipulation Language 15<br/>1.4.4 The SQL Data-Manipulation Language 16<br/>1.4.5 Database Access from Application Programs 16<br/>1.5 Database Design 17<br/>1.6 Database Engine 18<br/>1.6.1 Storage Manager 19<br/>1.6.2 The Query Processor 20<br/>1.6.3 Transaction Management 20<br/>1.7 Database and Application Architecture 21<br/>1.8 Database Users and Administrators 23<br/>1.8.1 Database Users and User Interfaces 24<br/>1.8.2 Database Administrator 24<br/>1.9 History of Database Systems 25<br/>1.10 Summary 29<br/>Review Terms 30<br/>Practice Exercises 31<br/>Exercises 32<br/>Tools 33<br/>Further Reading 33<br/>Bibliography 33<br/>PART 1 RELATIONAL LANGUAGES<br/>Chapter 2 Introduction to the Relational Model 37<br/>2.1 Structure of Relational Databases37<br/>2.2 Database Schema41<br/>2.3 Keys43<br/>2.4 Schema Diagrams46<br/>2.5 Relational Query Languages47<br/>2.6 Summary48<br/>Review Terms49<br/>Practice Exercises49<br/>Exercises50<br/>Further Reading51<br/>Bibliography51<br/>Chapter 3 Introduction to SQL 53<br/>3.1 Overview of the SQL Query Language53<br/>3.2 SQL Data Definition54<br/>3.2.1 Basic Types55<br/>3.2.2 Basic Schema Definition 56<br/>3.3 Basic Structure of SQL Queries 59<br/>3.3.1 Queries on a Single Relation 59<br/>3.3.2 Queries on Multiple Relations 62<br/>3.4 Additional Basic Operations 67<br/>3.4.1 The Rename Operation 67<br/>3.4.2 String Operations 70<br/>3.4.3 Attribute Specification in the Select Clause 71<br/>3.4.4 Ordering the Display of Tuples 71<br/>3.4.5 Where-Clause Predicates 72<br/>3.5 Set Operations 73<br/>3.5.1 The Union Operation 74<br/>3.5.2 The Intersect Operation 75<br/>3.5.3 The Except Operation 76<br/>3.6 Null Values 77<br/>3.7 Aggregate Functions 79<br/>3.7.1 Basic Aggregation 79<br/>3.7.2 Aggregation with Grouping 80<br/>3.7.3 The Having Clause 83<br/>3.7.4 Aggregation with Null and Boolean Values 84<br/>3.8 Nested Subqueries 86<br/>3.8.1 Set Membership 86<br/>3.8.2 Set Comparison 87<br/>3.8.3 Test for Empty Relations 89<br/>3.8.4 Test for the Absence of Duplicate Tuples 91<br/>3.8.5 Subqueries in the From Clause 92<br/>3.8.6 The With Clause 93<br/>3.8.7 Scalar Subqueries 94<br/>3.8.8 Scalar Without a From Clause 95<br/>3.9 Modification of the Database 96<br/>3.9.1 Deletion 96<br/>3.9.2 Insertion 98<br/>3.9.3 Updates 99<br/>3.10 Summary 102<br/>Review Terms 103<br/>Practice Exercises 103<br/>Exercises 107<br/>Tools 111<br/>Further Reading 112<br/>Bibliography 112<br/>Chapter 4 Intermediate SQL 113<br/>4.1 Join Expressions113<br/>4.1.1 The Natural Join114<br/>4.1.2 Join Conditions118<br/>4.1.3 Outer Joins119<br/>4.1.4 Join Types and Conditions124<br/>4.2 Views125<br/>4.2.1 View Definition126<br/>4.2.2 Using Views in SQL Queries126<br/>4.2.3 Materialized Views128<br/>4.2.4 Update of a View128<br/>4.3 Transactions131<br/>4.4 Integrity Constraints133<br/>4.4.1 Constraints on a Single Relation134<br/>4.4.2 Not Null Constraint134<br/>4.4.3 Unique Constraint135<br/>4.4.4 The Check Clause135<br/>4.4.5 Referential Integrity137<br/>4.4.6 Assigning Names to Constraints139<br/>4.4.7 Integrity Constraint Violation During a Transaction139<br/>4.4.8 Complex Check Conditions and Assertions 140<br/>4.5 SQL Data Types and Schemas 141<br/>4.5.1 Date and Time Types in SQL 142<br/>4.5.2 Type Conversion and Formatting Functions 143<br/>4.5.3 Default Values 144<br/>4.5.4 Large-Object Types 144<br/>4.5.5 User-Defined Types 146<br/>4.5.6 Generating Unique Key Values 148<br/>4.5.7 Create Table Extensions 150<br/>4.5.8 Schemas, Catalogs, and Environments 150<br/>4.6 Index Definition in SQL 152<br/>4.7 Authorization 153<br/>4.7.1 Granting and Revoking of Privileges 154<br/>4.7.2 Roles 155<br/>4.7.3 Authorization on Views 157<br/>4.7.4 Authorizations on Schema 158<br/>4.7.5 Transfer of Privileges 158<br/>4.7.6 Revoking of Privileges 159<br/>4.7.7 Row-Level Authorization 161<br/>4.8 Summary 161<br/>Review Terms 163<br/>Practice Exercises 164<br/>Exercises 167<br/>Further Reading 168<br/>Bibliography 168<br/>Chapter 5 Advanced SQL 171<br/>5.1 Accessing SQL from a Programming Language171<br/>5.1.1 JDBC172<br/>5.1.2 Database Access from Python181<br/>5.1.3 ODBC182<br/>5.1.4 Embedded SQL185<br/>5.2 Functions and Procedures 186<br/>5.2.1 Declaring and Invoking SQL Functions and Procedures 187<br/>5.2.2 Language Constructs for Procedures and Functions 189<br/>5.2.3 External Language Routines 191<br/>5.3 Triggers 194<br/>5.3.1 Need for Triggers 194<br/>5.3.2 Triggers in SQL 195<br/>5.3.3 When Not to Use Triggers 198<br/>5.4 Recursive Queries 201<br/>5.4.1 Transitive Closure Using Iteration 202<br/>5.4.2 Recursion in SQL 204<br/>5.5 Advanced Aggregation Features 207<br/>5.5.1 Ranking 207<br/>5.5.2 Windowing 211<br/>5.5.3 Pivoting 214<br/>5.5.4 Rollup and Cube 215<br/>5.6 Summary 219<br/>Review Terms 219<br/>Practice Exercises 220<br/>Exercises 223<br/>Tools 225<br/>Further Reading 226<br/>Chapter 6 Formal-Relational Query Languages 227<br/>6.1 The Relational Algebra227<br/>6.1.1 The Select Operation228<br/>6.1.2 The Project Operation228<br/>6.1.3 Composition of Relational Operations229<br/>6.1.4 The Cartesian-Product Operation230<br/>6.1.5 The Join Operation 231<br/>6.1.6 Set Operations 232<br/>6.1.7 The Assignment Operation 234<br/>6.1.8 The Rename Operation 235<br/>6.1.9 Equivalent Queries 237<br/>6.2 The Tuple Relational Calculus 237<br/>6.2.1 Example Queries 237<br/>6.2.2 Formal Definition 241<br/>6.2.3 Safety of Expressions 242<br/>6.3 The Domain Relational Calculus 243<br/>6.3.1 Formal Definition 243<br/>6.3.2 Example Queries 244<br/>6.3.3 Safety of Expressions 245<br/>6.4 Expressive Power of Pure Relational Query Languages 246<br/>6.5 Summary 247<br/>Review Terms 247<br/>Practice Exercises 247<br/>Exercises 250<br/>Further Reading 252<br/>Bibliography 253<br/>PART 2 DATABASE DESIGN AND APPLICATION DEVELOPMENT<br/>Chapter 7 Database Design Using the E-R Model 257<br/>7.1 Overview of the Design Process257<br/>7.1.1 Design Phases257<br/>7.1.2 Design Alternatives259<br/>7.2 The Entity-Relationship Model260<br/>7.2.1 Entity Sets260<br/>7.2.2 Relationship Sets262<br/>7.3 Complex Attributes 265<br/>7.4 Mapping Cardinalities 268<br/>7.5 Primary Key 272<br/>7.5.1 Entity Sets 273<br/>7.5.2 Relationship Sets 273<br/>7.5.3 Weak Entity Sets 275<br/>7.6 Removing Redundant Attributes in Entity Sets 277<br/>7.7 Reducing E-R Diagrams to Relational Schemas 280<br/>7.7.1 Representation of Strong Entity Sets 281<br/>7.7.2 Representation of Strong Entity Sets with Complex Attributes 281<br/>7.7.3 Representation of Weak Entity Sets 283<br/>7.7.4 Representation of Relationship Sets 284<br/>7.7.5 Redundancy of Schemas 285<br/>7.7.6 Combination of Schemas 286<br/>7.8 Extended E-R Features 287<br/>7.8.1 Specialization 287<br/>7.8.2 Generalization 289<br/>7.8.3 Attribute Inheritance 290<br/>7.8.4 Constraints on Specializations 291<br/>7.8.5 Aggregation 292<br/>7.8.6 Reduction to Relation Schemas 293<br/>7.9 Entity-Relationship Design Issues 295<br/>7.9.1 Common Mistakes in E-R Diagrams 296<br/>7.9.2 Use of Entity Sets versus Attributes 297<br/>7.9.3 Use of Entity Sets versus Relationship Sets 298<br/>7.9.4 Binary versus n-ary Relationship Sets 299<br/>7.10 Alternative Notations for Modeling Data 301<br/>7.10.1 Alternative E-R Notations 301<br/>7.10.2 The Unified Modeling Language UML 304<br/>7.11 Other Aspects of Database Design 307<br/>7.11.1 Functional Requirements 307<br/>7.11.2 Data Flow, Workflow 307<br/>7.11.3 Schema Evolution 308<br/>7.12 Summary 308<br/>Review Terms 310<br/>Practice Exercises 310<br/>Exercises 313<br/>Tools 316<br/>Further Reading 316<br/>Bibliography 317<br/>Chapter 8 Relational Database Design 319<br/>8.1 Features of Good Relational Designs 319<br/>8.1.1 Decomposition 321<br/>8.1.2 Lossless Decomposition 323<br/>8.1.3 Normalization Theory 324<br/>8.2 Decomposition Using Functional Dependencies 324<br/>8.2.1 Notational Conventions 325<br/>8.2.2 Keys and Functional Dependencies 325<br/>8.2.3 Lossless Decomposition and Functional Dependencies 328<br/>8.3 Normal Forms 329<br/>8.3.1 Boyce-Codd Normal Form 329<br/>8.3.2 Third Normal Form 333<br/>8.3.3 Comparison of BCNF and 3NF 334<br/>8.3.4 Higher Normal Forms 335<br/>8.4 Functional-Dependency Theory 336<br/>8.4.1 Closure of a Set of Functional Dependencies 336<br/>8.4.2 Closure of Attribute Sets 338<br/>8.4.3 Canonical Cover 340<br/>8.4.4 Dependency Preservation 344<br/>8.5 Algorithms for Decomposition Using Functional Dependencies 346<br/>8.5.1 BCNF Decomposition 346<br/>8.5.2 3NF Decomposition 349<br/>8.5.3 Correctness of the 3NF Algorithm 350<br/>8.6 Decomposition Using Multivalued Dependencies 352<br/>8.6.1 Multivalued Dependencies 353<br/>8.6.2 Fourth Normal Form 355<br/>8.6.3 4NF Decomposition 356<br/>8.7 More Normal Forms 357<br/>8.8 Atomic Domains and First Normal Form 358<br/>8.9 Database-Design Process 359<br/>8.9.1 E-R Model and Normalization 360<br/>8.9.2 Naming of Attributes and Relationships 361<br/>8.9.3 Denormalization for Performance 362<br/>8.9.4 Other Design Issues 362<br/>8.10 Modeling Temporal Data 363<br/>8.11 Summary 367<br/>Review Terms 368<br/>Practice Exercises 369<br/>Exercises 373<br/>Further Reading 376<br/>Bibliography 377<br/>Chapter 9 Application Development 379<br/>9.1 Application Programs and User Interfaces 379<br/>9.2 Web Fundamentals 381<br/>9.2.1 Uniform Resource Locators 381<br/>9.2.2 HyperText Markup Language 382<br/>9.2.3 Web Servers and Sessions 384<br/>9.3 Servlets 387<br/>9.3.1 A Servlet Example 387<br/>9.3.2 Servlet Sessions 389<br/>9.3.3 Servlet Life Cycle 391<br/>9.3.4 Application Servers 392<br/>9.4 Alternative Server-Side Frameworks 392<br/>9.4.1 Server-Side Scripting 392<br/>9.4.2 Web Application Frameworks 394<br/>9.4.3 The Django Framework 395<br/>9.5 Client-Side Code and Web Services 397<br/>9.5.1 JavaScript 397<br/>9.5.2 Web Services 402<br/>9.5.3 Disconnected Operation 403<br/>9.5.4 Mobile Application Platforms 404<br/>9.6 Application Architectures 405<br/>9.6.1 The Business-Logic Layer 407<br/>9.6.2 The Data-Access Layer and Object-Relational Mapping 407<br/>9.7 Application Performance 410<br/>9.7.1 Reducing Overhead by Caching 411<br/>9.7.2 Parallel Processing 413<br/>9.8 Application Security 413<br/>9.8.1 SQL Injection 414<br/>9.8.2 Cross-Site Scripting and Request Forgery 415<br/>9.8.3 Password Leakage 416<br/>9.8.4 Application-Level Authentication 417<br/>9.8.5 Application-Level Authorization 419<br/>9.8.6 Audit Trails 421<br/>9.8.7 Privacy 422<br/>9.9 Encryption and Its Applications 423<br/>9.9.1 Encryption Techniques 423<br/>9.9.2 Encryption Support in Databases 425<br/>9.9.3 Encryption and Authentication 426<br/>9.10 Summary 429<br/>Review Terms 430<br/>Practice Exercises 431<br/>Exercises 432<br/>Project Suggestions 434<br/>Tools 438<br/>Further Reading 438<br/>Bibliography 439<br/>PART 3 DATA MANAGEMENT IMPLEMANTATION<br/>Chapter 10 Storage Management 443<br/>10.1 Overview of Physical Storage Media443<br/>10.2 Storage Interfaces446<br/>10.3 Magnetic Disks447<br/>10.3.1 Physical Characteristics of Disks 447<br/>10.3.2 Performance Measures of Disks 449<br/>10.4 Flash Memory 451<br/>10.5 File Organization 454<br/>10.5.1 Fixed-Length Records 454<br/>10.5.2 Variable-Length Records 457<br/>10.5.3 Storing Large Objects 459<br/>10.6 Organization of Records in Files 460<br/>10.6.1 Heap File Organization 461<br/>10.6.2 Sequential File Organization 463<br/>10.6.3 Multitable Clustering File Organization 465<br/>10.6.4 Partitioning 467<br/>10.7 Data-Dictionary Storage 467<br/>10.8 Database Buffer 470<br/>10.8.1 Buffer Manager 470<br/>10.8.2 Buffer-Replacement Strategies 473<br/>10.8.3 Reordering of Writes and Recovery 475<br/>10.9 Summary 476<br/>Review Terms 477<br/>Practice Exercises 479<br/>Exercises 480<br/>Further Reading 481<br/>Bibliography 482<br/>Chapter 11 Indexing 483<br/>11.1 Basic Concepts483<br/>11.2 Ordered Indices485<br/>11.2.1 Dense and Sparse Indices486<br/>11.2.2 Multilevel Indices488<br/>11.2.3 Index Update490<br/>11.2.4 Secondary Indices492<br/>11.2.5 Indices on Multiple Keys493<br/>11.3 B+-Tree Index Files 494<br/>11.3.1 Structure of a B+-Tree 494<br/>11.3.2 Queries on B+-Trees 497<br/>11.3.3 Updates on B+-Trees 501<br/>11.3.4 Complexity of B+-Tree Updates 507<br/>11.3.5 Nonunique Search Keys 509<br/>11.4 Hash Indices 510<br/>11.5 Multiple-Key Access 513<br/>11.5.1 Using Multiple Single-Key Indices 513<br/>11.5.2 Indices on Multiple Keys 514<br/>11.5.3 Covering Indices 515<br/>11.6 Creation of Indices 516<br/>11.7 Bitmap Indices 517<br/>11.8 Summary 519<br/>Review Terms 520<br/>Practice Exercises 521<br/>Exercises 523<br/>Further Reading 524<br/>Bibliography 524<br/>Chapter 12 Query Processing and Optimization 525<br/>12.1 Overview525<br/>12.2 Measures of Query Cost528<br/>12.3 Execution of Relational Algebra Operations531<br/>12.3.1 Selection Operation531<br/>12.3.2 Sorting537<br/>12.3.3 Join Operation540<br/>12.3.4 Other Operations555<br/>12.4 Evaluation of Expressions560<br/>12.4.1 Materialization560<br/>12.4.2 Pipelining 561<br/>12.4.3 Pipelines for Continuous-Stream Data 564<br/>12.5 Query Optimization 564<br/>12.5.1 Overview 565<br/>12.5.2 Transformation of Relational Expressions 567<br/>12.5.3 Estimating Statistics of Expression Results 578<br/>12.5.4 Choice of Evaluation Plans 587<br/>12.6 Summary 599<br/>Review Terms 602<br/>Practice Exercises 603<br/>Exercises 609<br/>Further Reading 611<br/>Bibliography 611<br/>Chapter 13 Transaction Management 613<br/>13.1 Transaction Concept 613<br/>13.2 A Simple Transaction Model 615<br/>13.3 Storage Structure 618<br/>13.4 Transaction Atomicity and Durability 619<br/>13.5 Transaction Isolation 621<br/>13.6 Serializability 626<br/>13.7 Transaction Isolation and Atomicity 633<br/>13.7.1 Recoverable Schedules 633<br/>13.7.2 Cascadeless Schedules 634<br/>13.8 Transaction Isolation Levels 635<br/>13.9 Implementation of Isolation Levels 637<br/>13.9.1 Locking 637<br/>13.9.2 Timestamps 639<br/>13.9.3 Multiple Versions and Snapshot Isolation 639<br/>13.10 Transactions as SQL Statements 640<br/>13.11 Summary 642<br/>Review Terms 644<br/>Practice Exercises 645<br/>Exercises 646<br/>Further Reading 648<br/>Bibliography 648<br/>Chapter 14 Concurrency Control and Recovery 649<br/>14.1 Lock-Based Protocols649<br/>14.1.1 Locks649<br/>14.1.2 Granting of Locks654<br/>14.1.3 The Two-Phase Locking Protocol 655<br/>14.1.4 Implementation of Locking 658<br/>14.1.5 Graph-Based Protocols 660<br/>14.2 Deadlock Handling 663<br/>14.2.1 Deadlock Prevention 663<br/>14.2.2 Deadlock Detection and Recovery 665<br/>14.3 Multiple Granularity 667<br/>14.4 Insert Operations, Delete Operations, and Predicate Reads 671<br/>14.4.1 Deletion 671<br/>14.4.2 Insertion 672<br/>14.4.3 Predicate Reads and The Phantom Phenomenon 672<br/>14.5 Timestamp-Based Protocols 675<br/>14.5.1 Timestamps 675<br/>14.5.2 The Timestamp-Ordering Protocol 676<br/>14.5.3 Thomas?Write Rule 678<br/>14.6 Validation-Based Protocols 680<br/>14.7 Multiversion Schemes 683<br/>14.7.1 Multiversion Timestamp Ordering 684<br/>14.7.2 Multiversion Two-Phase Locking 685<br/>14.8 Failure Classification 686<br/>14.9 Storage 688<br/>14.9.1 Stable-Storage Implementation 688<br/>14.9.2 Data Access 690<br/>14.10 Recovery and Atomicity 692<br/>14.10.1 Log Records 692<br/>14.10.2 Database Modification 694<br/>14.10.3 Concurrency Control and Recovery 695<br/>14.10.4 Transaction Commit 696<br/>14.10.5 Using the Log to Redo and Undo Transactions 696<br/>14.10.6 Checkpoints 700<br/>14.11 Recovery Algorithm 702<br/>14.11.1 Transaction Rollback 702<br/>14.11.2 Recovery After a System Crash 702<br/>14.11.3 Optimizing Commit Processing 704<br/>14.12 Buffer Management 705<br/>14.12.1 Log-Record Buffering 706<br/>14.12.2 Database Buffering 707<br/>14.12.3 Operating System Role in Buffer Management 709<br/>14.12.4 Fuzzy Checkpointing 710<br/>14.13 Summary 710<br/>Review Terms 714<br/>Practice Exercises 716<br/>Exercises 719<br/>Further Reading 721<br/>Bibliography 721<br/>PART 4 ADVANCED TOPICS<br/>Chapter 15 Big Data Analytics<br/>Chapter 16 Blockchain Databases <br/>Chapter 17 Advanced Application Development<br/>Appendix A Detailed University Schema<br/><br/> 第四部分和附录A为在线章节,请扫描本书前面衬纸上的二维码,在获取正版官方授权后进行阅读。—编辑注