Relaciones
Esta orden abre la ventana Diseño de relaciones, que permite definir relaciones entre las diversas tablas de la base de datos.
Aquí puede enlazar las tablas de la base de datos actual mediante sus campos de datos comunes. Pulse en el icono Relación nueva para crear las relaciones, o utilice el ratón para arrastrar y colocar.
Esta función sólo está disponible si se utiliza una base de datos relacional.
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.
Si está abierta la ventana Diseño de relaciones, no se pueden modificar las tablas seleccionadas, ni siquiera en modo de diseño de tabla. Es una forma de garantizar que las tablas no se modifiquen durante el establecimiento de relaciones.
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.
Los campos de datos a los que se ha asignado una llave primaria se identifican en la ventana de la tabla con el símbolo de una llave.
Definir relaciones
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.
Otra posibilidad es pulsar en el símbolo Relación nueva situado en la parte superior de la ventana y definir la relación entre las dos tablas en el diálogo Relaciones.
Si utiliza LibreOffice como interfaz de usuario de una base de datos relacional, LibreOffice no almacena las operaciones de creación y borrado de relaciones en una memoria intermedia, sino que las remite directamente a la base de datos.
Si efectúa una doble pulsación en una de las líneas de conexión podrá asignar propiedades específicas a la relación. Se abre el diálogo Relaciones.