TAILIEUCHUNG - Applied Mathematics for Database Professionals phần 8

Trong mô hình quan hệ của dữ liệu, tất cả các thuộc tính trong một thiết kế cơ sở dữ liệu là bắt buộc. Do đó, bạn có thể xem xét nó một sự thất vọng rằng trong tiêu chuẩn SQL theo mặc định, một cột là nullable, SQL đòi hỏi chúng ta thêm không phải null một cách rõ ràng bên cạnh mỗi cột để làm cho nó bắt buộc. | CHAPTER 11 IMPLEMENTING DATABASE DESIGNS IN ORACLE 259 In the relational model of data all attributes in a database design are mandatory. Therefore you can consider it a disappointment that in the SQL standard by default a column is nullable SQL requires us to add not null explicitly alongside every column to make it mandatory. The next section deals with the aforementioned narrowing down of the built-in data types that were used in the create table statements. Implementing Attribute Constraints We now revisit the matter with regards to the term attribute constraints mentioned in the section Classification Schema for Constraints in Chapter 7 . Formally a characterization just attaches attribute-value sets to attributes. Attaching an attribute-value set to an attribute can be considered an attribute constraint. However in practice you implement database designs in SQL DBMSes that are notorious for their poor support of user-defined types. User-defined types would have been ideal for implementing attributevalue sets. However as discussed in the section Implementing Table Structures you can t use them to do so. Instead you must use an appropriate superset some built-in data type as shown in the previous section as the attribute-value set of a given attribute. Luckily you can use declarative SQL check constraints to narrow down these supersets to exactly the attributevalue set that was specified in the characterizations. During implementation we refer to these declarative check constraints as the attribute constraints of an attribute. All attribute constraints can and given our preference in strategies should be stated as declarative check constraints. You can declare these constraints using the alter table add constraint statement. Listing 11-14 shows the declaration of six check constraints that are required to declara-tively implement the attribute-value sets for the EMP table structure as defined in the definition of chr_EMP in Listing 7-2. We ll discuss each of .

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.