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

Đặt cơ sở Đối với một số đối tượng, có thể có nhiều phím có thể chính để lựa chọn: số lượng nhân viên, số giấy phép lái xe, số thẻ quốc gia (SSN). Trong trường hợp này, tất cả các khóa chính tiềm năng được gọi là các phím ứng cử viên. | Part I Laying the Foundation For some entities there might be multiple possible primary keys to choose from employee number driver s license number national ID number ssn . In this case all the potential primary keys are known as candidate keys. Candidate keys that are not selected as the primary key are then known as alternate keys. It s important to document all the candidate keys because later at the SQL DLL layer they will need unique constraints. At the conceptual diagramming phase a primary key might be obvious an employee number an automobile VIN number a state or region name but often there is no clearly recognizable uniquely identifying value for each item in reality. That s OK as that problem can be solved later during the SQL DLL layer. Foreign keys When two entities tables relate to one another one entity is typically the primary entity and the other entity is the secondary entity. The connection between the two entities is made by replicating the primary key from the primary entity in the secondary entity. The duplicated attributes in the secondary entity are known as a foreign key. Informally this type of relationship is sometimes called a parent-child relationship. Enforcing the foreign key is referred to as referential integrity. The classic example of a primary key and foreign key relationship is the order and order details relationship. Each order item primary entity can have multiple order detail rows secondary entity . The order s primary key is duplicated in the order detail entity providing the link between the two entities as shown in Figure 3-3. You ll see several examples of primary keys and foreign keys in the Data Design Patterns section later in this chapter. Cardinality The cardinality of the relationship describes the number of tuples rows on each side of the relationship. Either side of the relationship may be restricted to allow zero one or multiple tuples. The type of key enforces the restriction of multiple tuples. Primary keys are

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.