Fundamentals of Database systems 3th edition PHẦN 5

Ví dụ, một ví dụ mối quan hệ (i, s, c) không nên tồn tại trong ƯU ĐÃI trừ khi một thể hiện (i, s) tồn tại trong TAUGHT_DURING, một ví dụ (s, c) tồn tại trong OFFERED_DURING, và một thể hiện (i, c) tồn tại CAN_TEACH. Tuy nhiên, | The use of an extent name departments in Q0 as an entry point refers to a persistent collection of objects. Whenever a collection is referenced in an OQL query we should define an iterator variable Note 22 d in Q0 that ranges over each object in the collection. In many cases as in Q0 the query will select certain objects from the collection based on the conditions specified in the where-clause. In Q0 only persistent objects d in the collection of departments that satisfy the condition Engineering are selected for the query result. For each selected object d the value of is retrieved in the query result. Hence the type of the result for Q0 is bag string because the type of each dname value is string even though the actual result is a set because dname is a key attribute . In general the result of a query would be of type bag for select . . . from . . . and of type set for select distinct . . . from . . . as in SQL adding the keyword distinct eliminates duplicates . Using the example in Q0 there are three syntactic options for specifying iterator variables d in departments departments d departments as d We will use the first construct in our examples Note 23 . The named objects used as database entry points for OQL queries are not limited to the names of extents. Any named persistent object whether it refers to an atomic single object or to a collection object can be used as a database entry point. Query Results and Path Expressions The result of a query can in general be of any type that can be expressed in the ODMG object model. A query does not have to follow the select . . . from . . . where . . . structure in the simplest case any persistent name on its own is a query whose result is a reference to that persistent object. For example the query Q1 departments returns a reference to the collection of all persistent department objects whose type is set Department . Similarly suppose we had given via the database bind operation see Figure .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
48    78    2    29-05-2024
164    169    2    29-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.