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

Joe Celko s SQL for Smarties - Advanced SQL Programming P53. 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. | 492 CHAPTER 22 AUXILIARY TABLES CHECK CASE WHEN code_type DDC AND code_value SIMILAR TO 0-9 0-9 0-9 . 0-9 0-9 09 THEN 1 WHEN code_type ICD AND code_value SIMILAR TO 0-9 0-9 0-9 . 0-9 0-9 09 THEN 1 WHEN code_type ISO3166 AND code_value SIMILAR TO A-Z A-Z THEN 1 ELSE 0 END 1 code_description VARCHAR 255 NOT NULL PRIMARY KEY code_value code_type Since the typical application database can have dozens and dozens of codes in it you just keep extending this pattern for as long as required. Not very pretty is it That is why most OTLT programmers do not bother with it and thus destroy data integrity. The next thing you notice about this table is that the columns are pretty wide VARCHAR n or even worse that they use NVARCHAR n . The value of n is most often the largest one allowed in that particular SQL product. Since you have no idea what is going to be shoved into the table there is no way to predict and design with a safe reasonable maximum size. The size constraint has to be put into the when clause of that second check constraint between code_type and code_value. These large sizes tend to invite bad data. You give someone a VARCHAR n column and you eventually get a string with a lot of white space and a small odd character sitting at the end of it. You give someone an NVARCHAR 255 column and eventually it will get a Buddhist sutra in Chinese Unicode. I am sure of this because I load the Diamond or Heart Sutra when I get called to evaluate a database. If you make an error in the code_type or code_description among codes with the same structure it might not be detected. You can turn from Natural Sciences and Mathematics in Dewey Decimal codes into Coal Workers Pneumoconiosis in ICD and vice versa. This can be really difficult to find when one of the similarly structured schemes had unused codes in it. Auxiliary Function Tables 493 Now let s consider the problems with actually using the OTLT in the DML. It is always necessary to add the code_type as well as .

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.