TAILIEUCHUNG - Joe Celko s SQL for Smarties - Advanced SQL Programming P41

Joe Celko s SQL for Smarties - Advanced SQL Programming P41. In the SQL database community, Joe Celko is a well-known columnist and purveyor of valuable insights. In Joe Celko's SQL for Smarties: Advanced SQL Programming, he picks up where basic SQL training and experience leaves many database professionals and offers tips, techniques, and explanations that help readers extend their capabilities to top-tier SQL programming. Although Celko denies that the book is about database theory, he nevertheless alludes to theory often to buttress his practical points. This title is not for novices, as the author points out. Instead, its intended audience. | 372 CHAPTER 18 VIEWS DERIVED TABLES MATERIALIZED TABLES AND TEMPORARY TABLES CREATE VIEW Foo1 updatable has a key AS SELECT FROM Foobar WHERE x IN 1 2 CREATE VIEW Foo2 not updatable AS SELECT FROM Foobar WHERE x 1 UNION ALL SELECT FROM Foobar WHERE x 2 But Fool is updatable and Foo2 is not. While I know of no formal proof I suspect that determining whether a complex query resolves to an updatable query for allowed sets of data values possible in the table is an NP-complete problem. Without going into details here is a list of types of queries that can yield updatable views as taken from VIEW Update Is Practical Goodman 1990 1. Projection from a single table Standard SQL 2. Restriction projection from a single table Standard SQL 3. UNION VIEWS 4. Set difference views 5. One-to-one joins 6. One-to-one outer joins 7. One-to-many joins 8. One-to-many outer joins 9. Many-to-many joins 10. Translated and coded fields The create trigger mechanism for tables indicates an action to be performed before after or instead of a regular insert update or delete to that table. It is possible for a user to write instead of triggers on views which catch the changes and route Types of VIEWs 373 them to the base tables that make up the view. The database designer has complete control over the way views are handled. Types of VIEWs The type of select statements and their purpose can classify views. The strong advantage of a view is that it will produce the correct results when it is invoked based on the current data. Trying to do the same sort of things with temporary tables or computed columns within a table can be subject to errors and slower to read from disk. Single-Table Projection and Restriction In practice many VIEWs are projections or restrictions on a single base table. This is a common method for obtaining security control by removing rows or columns that a particular group of users is not allowed to see. These views are usually implemented as in-line macro .

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.