TAILIEUCHUNG - Hướng dẫn học Microsoft SQL Server 2008 part 58

Tạo Keys Các khóa chính và ngoài nước là các liên kết liên kết các bảng thành một cơ sở dữ liệu quan hệ làm việc. Tôi đối xử với những cột này như là một miền riêng biệt từ cột dữ liệu của người dùng. Thiết kế của các phím này có một tác dụng quan trọng về hiệu suất và khả năng sử dụng của các cơ sở dữ liệu vật lý. | Part IV Developing with SQL Server CREATE TABLE OrderPriority OrderPriorityID UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL DEFAULT NEWID PRIMARY KEY NONCLUSTERED OrderPriorityName NVARCHAR 15 NOT NULL OrderPriorityCode NVARCHAR 15 NOT NULL Priority INT NOT NULL ON Static Creating Keys The primary and foreign keys are the links that bind the tables into a working relational database. I treat these columns as a domain separate from the user s data column. The design of these keys has a critical effect on the performance and usability of the physical database. The database schema must transform from a theoretical logical design into a practical physical design and the structure of the primary and foreign keys is often the crux of the redesign. Keys are very difficult to modify once the database is in production. Getting the primary keys right during the development phase is a battle worth fighting. Primary keys The relational database depends on the primary key the cornerstone of the physical database schema. The debate over natural understood by users versus surrogate auto-generated primary keys is perhaps the biggest debate in the database industry. A physical-layer primary key has two purposes To uniquely identify the row To serve as a useful object for a foreign key SQL Server implements primary keys and foreign keys as constraints. The purpose of a constraint is to ensure that new data meets certain criteria or to block the data-modification operation. A primary-key constraint is effectively a combination of a unique constraint not a null constraint and either a clustered or non-clustered unique index. The surrogate debate pros and cons There s considerable debate over natural vs. surrogate keys. Natural keys are based on values found in reality and are preferred by data modelers who identify rows based on what makes them unique in reality. I know SQL Server MVPs who hold strongly to that position. But I know other just as intelligent MVPs who argue that the .

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.