DATABASE SYSTEM CONCEPTS

 1实体集合关系及的概念并不精确,这是可能的。以多种不同的方式定义一组实地以多种不同的方式定义一组实体和他们之间的关系和他们之间的关系。在本节中,我们将研究E_R,数据库模式设计中的基本问题,第七第七十节详细介绍了设计过程详细介绍了设计过程。   7.7.1,实体机遇与属性的使用。  考虑使用附加属性,电话号码的实体设计讲师。可以很容易的认为,电话是一个实体,他本身就,电话号码和地址的属性,该地点可能是电话所在的办公室或家庭,手机的价值是"移动"价值是。如果我们采用这个观点,我们就不会向,指导员添加电话号码的属性。相反我们可以创建。      .一个带有属性电话号码和位置的电话实体。      .一种inst_phone的关系。表示指导者和他们拥有电话之间的关系。     如图所示,那么,这两种定义之间的主要区别是什么呢??把电话当做一个属性的电话号码,意味着教师们每个人都有一个电话号码,把手机当作实体电话来处理,可以让老师有几个电话号码,包括零。但是我们可以轻松的将电话号码,定义为一个多值属性,允许每个教师使用多个电话。主要的区别是,把手机当作一个实体来更好的模拟,一个人可能想要获得关于电话的额外信息的研究。作为她的位置或他的类型(手机,我的电话或者普通的旧电话),或所有能分享的电话。

2因此,将电话作为一个实体来对待,比把它单作一个属性来对待更普通,并且在通常时更有用的时候是合适的。

相反,将属性名(hstruct)视为实体是不合适的;很难说名字是一个实体,与手机形成了鲜明的对比。因此将名字作为指导实集的属性是合适的。

由此产生了两个自然问题;什么构成了属性,以及什么构成了实体集?不幸的是,没有简单的答案。区别主要依赖于建模的真实企业的结构,以及与所讨论的属性相关的语义。

一个常见的错误是使用实体集的主键是不正确的,即使每个指导员只建议一个学生。关系顾问是表示学生和教师之间联系的正确方法,因为它使他们的连接显示,而不是通过属性隐示。

人们有时会犯的另一个相关错误是将相关实体集的主键属性指定为关系的属性。例如,ID(学生的主键)和ID(教师的主键)不应该作为关系顾问的属性出现。这是不应该做的,因为主键属性在关系集中已经隐含了。

3并不总是清楚对象是最好的用实体集还是关系集来表示。在图7.15中,我们使用了采取关系集来建模学生上(某一节)课程的情况。另一种方法是设想每个学生都有一个课程注册记录,然后,我们有一个实体来表示课程注册记录。让我们称之为实体集注册。每个注册实体都与一个学生和一个部分相关,因此我们有两个关系集,一个是将课程 注册记录与学生相关,另一个是将课程注册记录与部分联系起来。在图7.18中,我们展示了实体集部分和图7.15中的学习,将采取关系集替换为一个实体集和两个关系集:

·注册,代表课程注册记录的实体集。

·部分注册,与注册和课程相关的关系集。

·学生注册,与注册和学生相关的关系集。

请注意,我们使用双行线来表示注册实体的总参与情况。

 

4。。图7.18,取代注册和两个关系集。 图7.15和7.18,的方法都准确的代表了大学的信息,但是使用的方法更紧凑,可能更可取。然而,如果登记官办公室将其他信息与法庭登记记录联系在一起,最好把它作为一个实体。确定是否使用时,体积或关系及的一个可能的指导原则是,指定一种关系,即来描述实体之间的操作,这种方法也可以用于判断某些属性,是否可以更精确地表示为关系。

5数据库中的关系通常是2进制的,一些看似非二进制的关系实际上可以用一些二进制关系更好的表现出来。例如,一个人可以建立一个三元关系的父母,把一个孩子和他/她的母亲和父亲联系起来。然而,这样的关系也可以用两种二元关系来表示,父母和父亲分别是孩子和母亲的关系。使用父母双方的关系为我们提供了一个孩子母亲的记录,即使我们没有意识到父亲的身份,如果使用三元关系,则需要空值。在这种情况下使用二进制关系集更可取。

实际上,总是可以用许多不同的二进制关系集替换非二进制(n-ary,n-2)关系为ship。为简单起见,考虑抽象三元(n=3)关系集R,关联实体集A、B和C。我们用一个实体集合E替换关系集R,并创建三个关系集,如图7-19所示。

6.。我们可以用简单的方式将这个过程概括为n-ary关系的ship集合。因此,从概念上讲,我们可以将E-R模式限制为只包含二进制关系集。然而,这种限制并不是可取的。   .为创建的实体集必须创建一个标识属性。     表示关系集,增加了设计的复杂性(如我们所见 第7.6节)。 总体储存要求。   .N-ary关系集更清楚地展示了几个实体参与的一般关系。  可能没有办法将三种关系的约束转化为对二元关系的约束。举个例子,假设有一种说法认为R是多对一的,从B到C;也就是说,A和B中的每一种说法最多一个C实体关联。这个约束不能通过使用关系集RA上的基约束来表示。RB,Kc。

7在第7.2节中考虑关系集投影-euide,相关的讲师,学生和项目。我们不能直接把proj-guide瓜分解成教师和项目之间的二元关系,以及教师和学生之间的关系。如果我们这样做,我们可以录下,导师katz与学生shankar和zhang一起工作的项目A和B,但是,我们不能记录下卡齐与学生shankar一起在A项目上工作,和学生张一起工作,但是在项目A和项目B上没有合作。通过创建如上述的新实体集,可以将proj-guide分割为二进制关系。然而,这样做并不十分自然。

8关系的基数比会影响关系属性的放置。因此,一对一或一对多关系集的属性可以被关联到一个参与的实体集,而不是关系。例如,我们指定顾问是一对多的关系,一个教练可能建议几个学生,但可以建议每个学生只有一个老师。在这种情况下,属性日期指定何时讲师成为学生的顾问,可以与学生实体集合相关联,如图7.20所描述的。(为了保持图的简单,只显示了两个实体集的一些属性。)因为每个学生实体参与导师的关系最多一个实例,使这个属性名称有相同的意义与顾问公司将日期设置的关系。一对多关系的属性集只能重新定位,以实体集“许多”的关系。对于一对一,另一方面,关系属性可以与参与实体中的任何一个相关联。

在这种情况下,在何处放置描述性属性的设计决策作为一种关系或实体属性,应该反映出被建模的企业的特征。设计者可以选择保留日期作为顾问的属性,明确表示是指咨询关系,而不是学生大学地位的其他方面(例如,大学录取的日期)

9对于许多关系集来说,属性放置的选择更加明确。回到我们的实例,让我们指定可能更实际的。

如果导师是多对多关系,那么教师可以给一个或多个学生提供建议,而学生可以由一个或多个教师担任顾问。如果我们要表达某以特定教师成为某个学生的顾问的日期,那么日期必须是顾问的一个属性。

关系集,而不是参与其中的一个实体。例如,如果日期是学生的属性,我们无法确定哪位讲师在某一特定日期成为顾问。当一个属性由参与实体集的联合绑定确定,而不是单独的实体集合时,该属性必须与多对多关系集关联。图3.7,描述了日期作为关系属性的放置;同样,为了保持图的简单,只显示了两个实体集的一些属性。

10虽然基本的E-R概念可以建模大多数数据库特性,但是数据库的某些方面可以通过对基本E-R模型的某些扩展来更好地表达。在本节中,我们将讨论专门化 的扩展E-R特性、泛化、高级和低级实体集、属性继承和聚合。为了帮助讨论,我们将为大学使用一个稍微复杂一些的数据库模式。特别是,我们将通过定义一个具有属性ID、名称和地址的实体集Person来建模大学中的各种人。

 

实体集可以包括在某种程度上不同于集合中其他实体的实体的子组。例如,实体集中的实体子集可能具有实体集中的所有实体共享的属性。E-R模型为代表这些独特的实体分组提供了一种手段。例如,实体集Person可进一步归类为下列之一:

·员工

·学生

这些人员类型中的每一种都由一组属性描述,这些属性包括实体集Person的所有属性以及可能的附加属性。对于考试 ,员工实体可以用属性工资来进一步描述,而学生实体可以由属性totcred进一步描述。在实体集中指定子组的过程称为专门化。人员的spe 归一化允许我们根据人的实体是对应于员工还是学生来区分它们:一般来说,一个人可以是雇员,学生,两者都可以,或者两者都不是。


翻译自《DATABASE SYSTEM CONCEPTS》  Abraham Silberschatz   Henry F.Korth   S.Sudarshan

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Database System Concepts——数据库系统概念第六版(英文版) 作者: Abraham Silberschatz (Yale University) Henry F. Korth (Lehigh University) S. Sudarshan (Indian Institute of Technology, Bombay) 本书目录: Chapter 1 Introduction 1.1 Database-System Applications 1 1.2 Purpose of Database Systems 3 1.3 View of Data 6 1.4 Database Languages 9 1.5 Relational Databases 12 1.6 Database Design 15 1.7 Data Storage and Querying 20 1.8 Transaction Management 22 1.9 Database Architecture 23 1.10 Data Mining and Information Retrieval 25 1.11 Specialty Databases 26 1.12 Database Users and Administrators 27 1.13 History of Database Systems 29 1.14 Summary 31 Exercises 33 Bibliographical Notes 35 Chapter 2 Introduction to the RelationalModel 2.1 Structure of Relational Databases 39 2.2 Database Schema 42 2.3 Keys 45 2.4 Schema Diagrams 46 2.5 Relational Query Languages 47 2.6 Relational Operations 48 2.7 Summary 52 Exercises 53 Bibliographical Notes 55 Chapter 3 Introduction to SQL 3.1 Overview of the SQL Query Language 57 3.2 SQL Data Definition 58 3.3 Basic Structure of SQL Queries 63 3.4 Additional Basic Operations 74 3.5 Set Operations 79 3.6 Null Values 83 3.7 Aggregate Functions 84 3.8 Nested Subqueries 90 3.9 Modification of the Database 98 3.10 Summary 104 Exercises 105 Bibliographical Notes 112 Chapter 4 Intermediate SQL 4.1 Join Expressions 113 4.2 Views 120 4.3 Transactions 127 4.4 Integrity Constraints 128 4.5 SQL Data Types and Schemas 136 4.6 Authorization 143 4.7 Summary 150 Exercises 152 Bibliographical Notes 156 Chapter 5 Advanced SQL 5.1 Accessing SQL From a Programming Language 157 5.2 Functions and Procedures 173 5.3 Triggers 180 5.4 Recursive Queries 187 5.5 Advanced Aggregation Features 192 5.6 OLAP 197 5.7 Summary 209 Exercises 211 Bibliographical Notes 216 Chapter 6 Formal Relational Query Languages 6.1 The Relational Algebra 217 6.2 The Tuple Relational Calculus 239 6.3 The Domain Relational Calculus 245 6.4 Summary 248 Exercises 249 Bibliographical Notes 254 Chapter 7 Database Design and the E-R Model 7.1 Overview of the Design Process 259 7.2 The Entity-Relationship Model 262 7.3 Constraints 269 7.4 Removing Redundant Attributes in Entity Sets 272 7.5 Entity-Relationship Diagrams 274 7.6 Reduction to Relational Schemas 283 7.7 Entity-Relationship Design Issues 290 7.8 Extended E-R Features 295 7.9 Alternative Notations for Modeling Data 304 7.10 Other Aspects of Database Design 310 7.11 Summary 313 Exercises 315 Bibliographical Notes 321 Chapter 8 Relational Database Design 8.1 Features of Good Relational Designs 323 8.2 Atomic Domains and First Normal Form 327 8.3 Decomposition Using Functional Dependencies 329 8.4 Functional-Dependency Theory 338 8.5 Algorithms for Decomposition 348 8.6 Decomposition Using Multivalued Dependencies 355 8.7 More Normal Forms 360 8.8 Database-Design Process 361 8.9 Modeling Temporal Data 364 8.10 Summary 367 Exercises 368 Bibliographical Notes 374 Chapter 9 Application Design and Development 9.1 Application Programs and User Interfaces 375 9.2 Web Fundamentals 377 9.3 Servlets and JSP 383 9.4 Application Architectures 391 9.5 Rapid Application Development 396 9.6 Application Performance 400 9.7 Application Security 402 9.8 Encryption and Its Applications 411 9.9 Summary 417 Exercises 419 Bibliographical Notes 426 Chapter 10 Storage and File Structure 10.1 Overview of Physical Storage Media 429 10.2 Magnetic Disk and Flash Storage 432 10.3 RAID 441 10.4 Tertiary Storage 449 10.5 File Organization 451 10.6 Organization of Records in Files 457 10.7 Data-Dictionary Storage 462 10.8 Database Buffer 464 10.9 Summary 468 Exercises 470 Bibliographical Notes 473 Chapter 11 Indexing and Hashing 11.1 Basic Concepts 475 11.2 Ordered Indices 476 11.3 B+-Tree Index Files 485 11.4 B+-Tree Extensions 500 11.5 Multiple-Key Access 506 11.6 Static Hashing 509 11.7 Dynamic Hashing 515 11.8 Comparison of Ordered Indexing and Hashing 523 11.9 Bitmap Indices 524 11.10 Index Definition in SQL 528 11.11 Summary 529 Exercises 532 Bibliographical Notes 536 Chapter 12 Query Processing 12.1 Overview 537 12.2 Measures of Query Cost 540 12.3 Selection Operation 541 12.4 Sorting 546 12.5 Join Operation 549 12.6 Other Operations 563 12.7 Evaluation of Expressions 567 12.8 Summary 572 Exercises 574 Bibliographical Notes 577 Chapter 13 Query Optimization 13.1 Overview 579 13.2 Transformation of Relational Expressions 582 13.3 Estimating Statistics of Expression Results 590 13.4 Choice of Evaluation Plans 598 13.5 Materialized Views 607 13.6 Advanced Topics in Query Optimization 612 13.7 Summary 615 Exercises 617 Bibliographical Notes 622 Chapter 14 Transactions 14.1 Transaction Concept 627 14.2 A Simple Transaction Model 629 14.3 Storage Structure 632 14.4 Transaction Atomicity and Durability 633 14.5 Transaction Isolation 635 14.6 Serializability 641 14.7 Transaction Isolation and Atomicity 646 14.8 Transaction Isolation Levels 648 14.9 Implementation of Isolation Levels 650 14.10 Transactions as SQL Statements 653 14.11 Summary 655 Exercises 657 Bibliographical Notes 660 Chapter 15 Concurrency Control 15.1 Lock-Based Protocols 661 15.2 Deadlock Handling 674 15.3 Multiple Granularity 679 15.4 Timestamp-Based Protocols 682 15.5 Validation-Based Protocols 686 15.6 Multiversion Schemes 689 15.7 Snapshot Isolation 692 15.8 Insert Operations, Delete Operations, and Predicate Reads 697 15.9 Weak Levels of Consistency in Practice 701 15.10 Concurrency in Index Structures 704 15.11 Summary 708 Exercises 712 Bibliographical Notes 718 Chapter 16 Recovery System 16.1 Failure Classification 721 16.2 Storage 722 16.3 Recovery and Atomicity 726 16.4 Recovery Algorithm 735 16.5 Buffer Management 738 16.6 Failure with Loss of Nonvolatile Storage 743 16.7 Early Lock Release and Logical Undo Operations 744 16.8 ARIES 750 16.9 Remote Backup Systems 756 16.10 Summary 759 Exercises 762 Bibliographical Notes 766 Chapter 17 Database-System Architectures 17.1 Centralized and Client–Server Architectures 769 17.2 Server System Architectures 772 17.3 Parallel Systems 777 17.4 Distributed Systems 784 17.5 Network Types 788 17.6 Summary 791 Exercises 793 Bibliographical Notes 794 Chapter 18 Parallel Databases 18.1 Introduction 797 18.2 I/O Parallelism 798 18.3 Interquery Parallelism 802 18.4 Intraquery Parallelism 803 18.5 Intraoperation Parallelism 804 18.6 Interoperation Parallelism 813 18.7 Query Optimization 814 18.8 Design of Parallel Systems 815 18.9 Parallelism on Multicore Processors 817 18.10 Summary 819 Exercises 821 Bibliographical Notes 824 Chapter 19 Distributed Databases 19.1 Homogeneous and Heterogeneous Databases 825 19.2 Distributed Data Storage 826 19.3 Distributed Transactions 830 19.4 Commit Protocols 832 19.5 Concurrency Control in Distributed Databases 839 19.6 Availability 847 19.7 Distributed Query Processing 854 19.8 Heterogeneous Distributed Databases 857 19.9 Cloud-Based Databases 861 19.10 Directory Systems 870 19.11 Summary 875 Exercises 879 Bibliographical Notes 883 Chapter 20 DataWarehousing andMining 20.1 Decision-Support Systems 887 20.2 DataWarehousing 889 20.3 Data Mining 893 20.4 Classification 894 20.5 Association Rules 904 20.6 Other Types of Associations 906 20.7 Clustering 907 20.8 Other Forms of Data Mining 908 20.9 Summary 909 Exercises 911 Bibliographical Notes 914 Chapter 21 Information Retrieval 21.1 Overview 915 21.2 Relevance Ranking Using Terms 917 21.3 Relevance Using Hyperlinks 920 21.4 Synonyms, Homonyms, and Ontologies 925 21.5 Indexing of Documents 927 21.6 Measuring Retrieval Effectiveness 929 21.7 Crawling and Indexing the Web 930 21.8 Information Retrieval: Beyond Ranking of Pages 931 21.9 Directories and Categories 935 21.10 Summary 937 Exercises 939 Bibliographical Notes 941 Chapter 22 Object-Based Databases 22.1 Overview 945 22.2 Complex Data Types 946 22.3 Structured Types and Inheritance in SQL 949 22.4 Table Inheritance 954 22.5 Array and Multiset Types in SQL 956 22.6 Object-Identity and Reference Types in SQL 961 22.7 Implementing O-R Features 963 22.8 Persistent Programming Languages 964 22.9 Object-Relational Mapping 973 22.10 Object-Oriented versus Object-Relational 973 22.11 Summary 975 Exercises 976 Bibliographical Notes 980 Chapter 23 XML 23.1 Motivation 981 23.2 Structure of XML Data 986 23.3 XML Document Schema 990 23.4 Querying and Transformation 998 23.5 Application Program Interfaces to XML 1008 23.6 Storage of XML Data 1009 23.7 XML Applications 1016 23.8 Summary 1019 Exercises 1021 Bibliographical Notes 1024 PART EIGHT ADVANCED TOPICS Chapter 24 Advanced Application Development 24.1 Performance Tuning 1029 24.2 Performance Benchmarks 1045 24.3 Other Issues in Application Development 1048 24.4 Standardization 1051 24.5 Summary 1056 Exercises 1057 Bibliographical Notes 1059 Chapter 25 Spatial and Temporal Data andMobility 25.1 Motivation 1061 25.2 Time in Databases 1062 25.3 Spatial and Geographic Data 1064 25.4 Multimedia Databases 1076 25.5 Mobility and Personal Databases 1079 25.6 Summary 1085 Exercises 1087 Bibliographical Notes 1089 Chapter 26 Advanced Transaction Processing 26.1 Transaction-Processing Monitors 1091 26.2 TransactionalWorkflows 1096 26.3 E-Commerce 1102 26.4 Main-Memory Databases 1105 26.5 Real-Time Transaction Systems 1108 26.6 Long-Duration Transactions 1109 26.7 Summary 1115 Exercises 1117 Bibliographical Notes 1119 Chapter 27 PostgreSQL 27.1 Introduction 1123 27.2 User Interfaces 1124 27.3 SQL Variations and Extensions 1126 27.4 Transaction Management in PostgreSQL 1137 27.5 Storage and Indexing 1146 27.6 Query Processing and Optimization 1151 27.7 System Architecture 1154 Bibliographical Notes 1155 Chapter 28 Oracle 28.1 Database Design and Querying Tools 1157 28.2 SQL Variations and Extensions 1158 28.3 Storage and Indexing 1162 28.4 Query Processing and Optimization 1172 28.5 Concurrency Control and Recovery 1180 28.6 System Architecture 1183 28.7 Replication, Distribution, and External Data 1188 28.8 Database Administration Tools 1189 28.9 Data Mining 1191 Bibliographical Notes 1191 Chapter 29 IBM DB2 Universal Database 29.1 Overview 1193 29.2 Database-Design Tools 1194 29.3 SQL Variations and Extensions 1195 29.4 Storage and Indexing 1200 29.5 Multidimensional Clustering 1203 29.6 Query Processing and Optimization 1207 29.7 Materialized Query Tables 1212 29.8 Autonomic Features in DB2 1214 29.9 Tools and Utilities 1215 29.10 Concurrency Control and Recovery 1217 29.11 System Architecture 1219 29.12 Replication, Distribution, and External Data 1220 29.13 Business Intelligence Features 1221 Bibliographical Notes 1222 Chapter 30 Microsoft SQL Server 30.1 Management, Design, and Querying Tools 1223 30.2 SQL Variations and Extensions 1228 30.3 Storage and Indexing 1233 30.4 Query Processing and Optimization 1236 30.5 Concurrency and Recovery 1241 30.6 System Architecture 1246 30.7 Data Access 1248 30.8 Distributed Heterogeneous Query Processing 1250 30.9 Replication 1251 30.10 Server Programming in .NET 1253 30.11 XML Support 1258 30.12 SQL Server Service Broker 1261 30.13 Business Intelligence 1263 Bibliographical Notes 1267

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值