Database Systems: The Complete Book- P2
Thông tin tài liệu:
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ìm kiếm theo từ khóa liên quan:
Oracle cơ bản giáo trình cơ sở dữ liệu bảo mật cơ sở dữ liệu cơ sở dữ liệu Mysql giáo trình sqlGợi ý tài liệu liên quan:
-
62 trang 402 3 0
-
Giáo trình Cơ sở dữ liệu: Phần 2 - TS. Nguyễn Hoàng Sơn
158 trang 294 0 0 -
Giáo trình Cơ sở dữ liệu: Phần 2 - Đại học Kinh tế TP. HCM
115 trang 176 0 0 -
Giáo trình Cơ sở dữ liệu: Phần 1 - Sở Bưu chính Viễn Thông TP Hà Nội
48 trang 171 1 0 -
Giáo Trình về Cơ Sở Dữ Liệu - Phan Tấn Quốc
114 trang 119 1 0 -
Giáo trình cơ sở dữ liệu quan hệ_3
26 trang 106 0 0 -
Giáo trình Cơ sở dữ liệu (Ngành: Công nghệ thông tin - Trung cấp) - Trường Cao đẳng Xây dựng số 1
49 trang 100 0 0 -
54 trang 70 0 0
-
134 trang 63 1 0
-
0 trang 57 0 0
-
Bài giảng cơ sở dữ liệu - chương 1 - ĐH KHTN Tp.HCM
46 trang 48 0 0 -
Giáo trình Cơ sở dữ liệu: Phần 1 - ĐH công nghiệp Tp.HCM
41 trang 42 0 0 -
57 trang 40 1 0
-
Giáo trình Cơ sở dữ liệu - Phần 2: SQL Server - ĐH Công nghiệp Tp.HCM
147 trang 39 2 0 -
Giáo trình Cơ sở dữ liệu: Phần 2 - Cao Thị Nhạn, Nguyễn Thị Thanh Bình
55 trang 36 0 0 -
Asp.Net 3.5 In Simple Steps- P6
10 trang 35 0 0 -
Asp.Net 3.5 In Simple Steps- P4
10 trang 35 0 0 -
Thực hành cơ sở dữ liệu: Phần 2
92 trang 34 0 0 -
THỰC HÀNH LAB : PHƯƠNG PHÁP TẤN CÔNG CỦA HACKER VÀO CÁC ỨNG DỤNG WEB BỊ LỖI SQL INJECTION
124 trang 34 1 0 -
Asp.Net 3.5 In Simple Steps- P5
10 trang 33 0 0