Danh mục

Database Systems: The Complete Book- P2

Số trang: 50      Loại file: pdf      Dung lượng: 5.51 MB      Lượt xem: 9      Lượt tải: 0    
10.10.2023

Phí tải xuống: 12,000 VND Tải xuống file đầy đủ (50 trang) 0
Xem trước 5 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Database Systems: The Complete Book- P2: Database Systems and Database Design and Application courses offered at the junior, senior and graduate levels in Computer Science departments. Written by well-known computer scientists, this introduction to database systems offers a comprehensive approach, focusing on database design, database use, and implementation of database applications and database management systems
Nội dung trích xuất từ tài liệu:
Database Systems: The Complete Book- P2 CHAPTER 3. THE R.ELATIONAL DATA A4ODEL 3.3. CONVERTING SUBCLASS STRUCTURES TO RELATIONS 77 3.3.1 E/R-Style Conversion Our first approach is to create a relation for each entity set, as usual. If the Ships entity set E is not the root of the hierarchy, then the relation for E will include the key attributes at the root, to identify the entity represented by each tuple, plus all the attributes of E. In addition, if E is involved in a relationship, then sister we use these key attributes to identify entities of E in the relation corresponding to that relationship. Note, however, that although we spoke of isa as a relationship, it is unlike other relationships, in that it connects components of a single entity, not distinct entities. Thus, we do not create a relation for isa. Figure 3.12: An E/R diagram about sister ships b) Your answer to Exercise 2.4.1. c) Your answer to Exercise 2.4.4(a). I Movies 1 d) Your answer to Exercise 2.4.4(b). 3.3 Converting Subclass Structures to Relations When we have an isa-hierarchy of entity sets, we are presented with several choices of strategy for conversion to relations. Recall we assume that: There is a root entity set for the hierarchy, ElCartoons Mysteries Figure 3.13: The movie hierarchy This entity set has a key that serves to identify every entity represented by the hierarchy, and Example 3.9: Consider the hierarchy of Fig. 2.10, which we reproduce here as A given entity may have components that belong to the entity sets of any Fig. 3.13. The relations needed to represent the four different kinds of entities subtree of the hierarchy, as long as that subtree includes the root. in this hierarchy are: The principal conversion strategies are: 1. Movies (title, year, length, f ilmType). This relation was discussed in Example 3.1, and every movie is represented by a tuple here. 1. Follow the E/R viewpoint. For each entity set E in the hierarchy, create a plation that includes the key attributes from the root and any attributes 2. MurderMysteries(title, year, weapon). The first two attributes are belonging to E. the key for all movies, and the last is the lone attribute for the corre- spondi~~gentity set. Those movies that are murder mysteries have a tuple 2. Treat entities as objects belonging to a sin,gle class. For each possible here as well as in Movies. subtree including the root, create one relation, whose schema includes all the attributes of all the entity sets in the subtree. 3. Cartoons(title, year). This relation is the set of cartoons. It has no attrib ...

Tài liệu được xem nhiều:

Gợi ý tài liệu liên quan: