TAILIEUCHUNG - Define Relations Between Tables

2,4 Xác định mối quan hệ giữa bảng mối quan hệ xác định cách các thông tin của bạn cần "liên quan" giữa các bảng trong cơ sở dữ liệu của bạn. Ví dụ, có lẽ bạn có các bảng trong cơ sở dữ liệu của bạn được gọi là Khách hàng | Define Relations Between Tables Relationships define how your information needs to relate between tables in your database. For example perhaps you have tables in your database called Customers Orders and Order Details as the sample Northwind database does. You would want to create relationships between these tables to make sure that data integrity is maintained as users enter data into the database. Taking this further you need to make sure that each invoice has an existing customer for every invoice. This is called referential integrity. This How-To shows you how to create relationships as well how to view the relationships by using database diagrams. You have created a couple of tables where one relies on another to have data in it. In database terms they are related. How do you create relationships between tables Technique Referential integrity tells the database how tables are to relate to one another. You can use referential integrity to help control what data goes in each of tables based on data in other tables. To maintain referential integrity you need to create relationships between tables. An example of referential integrity from Northwind is that to have a record entered into the Orders table you have to have a record entered into the Customers table. The two tables are related by the CustomerID field which is found in both two tables. In the Customer table the CustomerID field is the primary key which means that it will be unique. In the Orders table the CustomerID field is a foreign key which means it points to a primary key in another table. You can see this displayed in the database diagram in Figure . Figure . The column CustomerID is the primary key in Customers and a foreign key in Orders. Note Database diagrams are the main graphical way to view edit and print relationships. You will find them listed under the database you are working on in the Server Explorer. You can also get the Property Pages for tables from this dialog box and .

TÀI LIỆU MỚI ĐĂNG
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.