SQL PROGRAMMING STYLE- P9

SQL PROGRAMMING STYLE- P9:Im mot trying to teach you to program in SQL in this book. You might want to read that again. If that is what you wanted, there are better books. This ought to be the second book you buy, not the first. I assume that you already write SQL at some level and want to get better at it. If you want to learn SQL programming tricks, get a copy of my other book, SQL for Smarties (3rd edition, 2005). | Your First Attempts Need Special Handling 177 GROUP BY This will put one person per row with a ranking in the alphabetical sort for their gender rather than one couple per row but that is still the same information from a simpler query. Notice that both solutions can leave unpaired people toward the end of the alphabet. You can add an ORDER BY clause to the cursor that passes the result set to the front-end program in a simple client server system but in architectures with multiple tiers sorting and other display functions might be performed differently in several places. For example the same data is displayed in English units sorted by division in the United States but displayed in SI units sorted by country in Europe. Your First Attempts Need Special Handling Henry Ledgard 1976 put it very nicely Pruning and restoring a blighted tree is almost an impossible task. The same is true of blighted computer programs. Restoring a structure that has been distorted by patches and deletions or fixing a program with a seriously weak algorithm isn t worth the time. The best that can result is a long inefficient unintelligible program that defies maintenance. The worst that could result we dare not think of. This is especially true with SQL but how to handle restarts in DDL and DML is different because of the declarative nature of the two sublanguages. DDL execution is static once it is put into place whereas DML is dynamic. That is if I issue the same CREATE schema object command it will have the same results each time but if I issue the same SELECT INSERT UPDATE or DELETE the execution plan could change each time. Do Not Be Afraid to Throw Away Your First Attempts at DDL Bad DDL will distort all of the code based on it. Just consider our little Dance Partner schema What if a proprietary BIT data type had been used for gender The code would not port to other SQL dialects. The host languages would have to handle low-level bit manipulation. It .

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
Đã 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.