TAILIEUCHUNG - Advanced SQL Database Programmer phần 4

người dùng có thể muốn thay đổi Table1, nhưng họ không muốn thay đổi Arbitrary_name, họ không thậm chí không biết nó ở đó. Đây là một ví dụ của một tầng lớp quan điểm là không thể cập nhật. Như chúng ta sẽ thấy, nó không phải là ví dụ duy nhất. Vì vậy, . Với điểm hợp nhất một mình, nó có thể xử lý hầu hết các quan điểm. Với xem hợp nhất và bảng tạm thời, nó có thể xử lý tất cả các điểm | This is where the name comes from since the CROSS JOIN acts like a multiplication operator. Relational division can be written as a single query thus SELECT DISTINCT pilot FROM Pilotskills AS PS1 WHERE NOT EXISTS SELECT FROM Hangar WHERE NOT EXISTS SELECT FROM PilotSkills AS PS2 WHERE AND The quickest way to explain what is happening in this query is to imagine an old World War II movie where a cocky pilot has just walked into the hangar looked over the fleet and announced There ain t no plane in this hangar that I can t fly which is good logic but horrible English. We are finding the pilots for whom there does not exist a plane in the hangar for which they have no skills. The use of the NOT EXISTS predicates is for speed. Most SQL systems will look up a value in an index rather than scan the whole table. This query for relational division was made popular by Chris Date in his textbooks but it is not the only method nor always the fastest. Another version of the division can be written so as to avoid three levels of nesting. While it is not original with me I have made it popular in my books. SELECT FROM PilotSkills AS PS1 Hangar AS H1 WHERE GROUP BY HAVING COUNT SELECT COUNT plane FROM Hangar There is a serious difference in the two methods. Burn down the hangar so that the divisor is empty. Because of the NOT 27 oracle EXISTSỘ predicates in Date s query all pilots are returned from a division by an empty set. Because of the COUNTỘ functions in my query no pilots are returned from a division by an empty set. In the sixth edition of his book Introduction to Database Systems Chris Date defined another operator DIVIDEBY . PER which produces the same results as my query but with more complexity. Another kind of relational division is exact relational division. The dividend table must match exactly to the values of the divisor without any extra values. SELECT

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.