Báo cáo tài liệu vi phạm
Giới thiệu
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
THỊ TRƯỜNG NGÀNH HÀNG
NÔNG NGHIỆP, THỰC PHẨM
Gạo
Rau hoa quả
Nông sản khác
Sữa và sản phẩm
Thịt và sản phẩm
Dầu thực vật
Thủy sản
Thức ăn chăn nuôi, vật tư nông nghiệp
CÔNG NGHIỆP
Dệt may
Dược phẩm, Thiết bị y tế
Máy móc, thiết bị, phụ tùng
Nhựa - Hóa chất
Phân bón
Sản phẩm gỗ, Hàng thủ công mỹ nghệ
Sắt, thép
Ô tô và linh kiện
Xăng dầu
DỊCH VỤ
Logistics
Tài chính-Ngân hàng
NGHIÊN CỨU THỊ TRƯỜNG
Hoa Kỳ
Nhật Bản
Trung Quốc
Hàn Quốc
Châu Âu
ASEAN
BẢN TIN
Bản tin Thị trường hàng ngày
Bản tin Thị trường và dự báo tháng
Bản tin Thị trường giá cả vật tư
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
NGÀNH HÀNG
NÔNG NGHIỆP, THỰC PHẨM
Gạo
Rau hoa quả
Nông sản khác
Sữa và sản phẩm
Thịt và sản phẩm
Dầu thực vật
Thủy sản
Thức ăn chăn nuôi, vật tư nông nghiệp
CÔNG NGHIỆP
Dệt may
Dược phẩm, Thiết bị y tế
Máy móc, thiết bị, phụ tùng
Nhựa - Hóa chất
Phân bón
Sản phẩm gỗ, Hàng thủ công mỹ nghệ
Sắt, thép
Ô tô và linh kiện
Xăng dầu
DỊCH VỤ
Logistics
Tài chính-Ngân hàng
NGHIÊN CỨU THỊ TRƯỜNG
Hoa Kỳ
Nhật Bản
Trung Quốc
Hàn Quốc
Châu Âu
ASEAN
BẢN TIN
Bản tin Thị trường hàng ngày
Bản tin Thị trường và dự báo tháng
Bản tin Thị trường giá cả vật tư
Thông tin
Tài liệu Xanh là gì
Điều khoản sử dụng
Chính sách bảo mật
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
Joe Celko s SQL for Smarties - Advanced SQL Programming P13
Đang chuẩn bị liên kết để tải về tài liệu:
Joe Celko s SQL for Smarties - Advanced SQL Programming P13
Bảo Thái
52
10
pdf
Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG
Tải xuống
Joe Celko s SQL for Smarties - Advanced SQL Programming P13. 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. | 92 CHAPTER 2 NORMALIZATION Consider this actual problem which appeared on CompuServe s ORACLE forum some years ago. A pharmaceutical company has an inventory table and price changes table that look like this CREATE TABLE Drugs drug_nbr INTEGER NOT NULL PRIMARY KEY drug_name CHAR 30 NOT NULL drug_qty INTEGER NOT NULL CONSTRAINT positive_quantity CHECK drug_qty 0 . CREATE TABLE Prices drug_nbr INTEGER NOT NULL start_date DATE NOT NULL end_date DATE NOT NULL CONSTRAINT started_before_endded CHECK start_date end_date price DECIMAL 8 2 NOT NULL PRIMARY KEY drug_nbr start_date Every order has to use the order date to find what the selling price was when the order was placed. The current price will have a value of eternity a dummy date set so high that it will not be reached such as 9999-12-31 . The end_date INTERVAL 1 DAY of one price will be equal to the start_date of the next price for the same drug. While this is normalized performance was bad. Every report invoice or query will have a JOIN between Drugs and Prices. The trick might be to add more columns to the Drugs like this CREATE TABLE Drugs drug_nbr INTEGER PRIMARY KEY drug_name CHAR 30 NOT NULL drug_qty INTEGER NOT NULL CONSTRAINT positive_quantity CHECK drug_qty 0 current_start_date DATE NOT NULL current_end_date DATE NOT NULL CONSTRAINT current_start_before_endded CHECK current_start_date current_end_date current_price DECIMAL 8 2 NOT NULL 2.11 Key Types 93 prior_start_date DATE NOT NULL prior_end_date DATE NOT NULL CONSTRAINT prior_start_before_endded CHECK prior_start_date prior_end_date AND current_start_date prior_end_date INTERVAL 1 DAY prior_price DECIMAL 8 2 NOT NULL . This covered more than 95 of the orders in the actual company because very few orders have more than two price changes before they are taken out of stock. The odd exception was trapped by a procedural routine. The other method is to add check constraints that will enforce the rules destroyed by denormalization. We will discuss this later
TÀI LIỆU LIÊN QUAN
JOE CELKO’S SQL PUZZLES & ANSWERS Second Edition
Joe Celko s SQL for Smarties - Advanced SQL Programming P84
Joe Celko s SQL for Smarties - Advanced SQL Programming P1
Joe Celko s SQL for Smarties - Advanced SQL Programming P2
Joe Celko s SQL for Smarties - Advanced SQL Programming P3
Joe Celko s SQL for Smarties - Advanced SQL Programming P4
Joe Celko s SQL for Smarties - Advanced SQL Programming P5
Joe Celko s SQL for Smarties - Advanced SQL Programming P6
Joe Celko s SQL for Smarties - Advanced SQL Programming P7
Joe Celko s SQL for Smarties - Advanced SQL Programming P8
Đã 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.