Quan hệ
Lệnh này mở cửa sổ Thiết kế Quan hệ mà cho phép bạn xác định quan hệ giữa các bảng cơ sở dữ liệu khác nhau.
Ở đây thì bạn có thể liên kết với nhau các bảng từ cơ sở dữ liệu hiện thời thông qua các trường dữ liệu chung với nhau. Nhấn vào biểu tượng Quan hệ mới để tạo quan hệ, hoặc kéo và thả bằng con chuột.
Hàm này chỉ sẵn sàng khi bạn thao tác cơ sở dữ liệu quan hệ.
When you choose Tools - Relationships, a window opens in which all the existing relationships between the tables of the current database are shown. If no relationships have been defined, or if you want to relate other tables of the database to each other, then click on the Add Tables icon. The Add Tables dialog opens in which you can select the tables with which to create a relation.
Cửa sổ Thiết kế Quan hệ còn mở thì không thể sửa đổi bảng đã chọn, ngay cả ở chế độ Thiết kế Bảng. Do đó đảm bảo rằng bảng không bị thay đổi trong khi tạo quan hệ.
The selected tables are shown in the top area of the relation design view. You can close a table window through the context menu or with the Delete key.
Primary key and foreign keys
If you want to define a relation among the various tables, you should enter a primary key that uniquely identifies a data field of an existing table. You can refer to the primary key from other tables to access the data of this table. All data fields referring to this primary key will be identified as a foreign key.
Tất cả các trường dữ liệu mà tham chiếu đến một khoá chính sẽ được ngụ ý trong cửa sổ bảng bằng một ký hiệu khoá nhỏ.
Xác định quan hệ
All existing relations are shown in the relations windows by a line that connects the primary and foreign key fields. You can add a relation by using drag-and-drop to drop the field of one table onto the field of the other table. A relation is removed again by selecting it and pressing the Delete key.
Thay vì vậy, bạn cũng có thể nhấn vào biểu tượng Quan hệ mới trong vùng trên của trường quan hệ, và xác định quan hệ giữa hai bảng trong hộp thoại Quan hệ.
If you use LibreOffice as the front-end for a relational database, the creation and deletion of relationships is not placed in an intermediate memory by LibreOffice, but is forwarded directly to the database.
Bằng cách nhấn đôi vào một đường kết nối, bạn có thể gán một số thuộc tính nào đó cho quan hệ đó. Hộp thoại Quan hệ sẽ mở.