Contenido
Índice 🔎︎

# Relaciones

Esta orden abre la ventana Diseño de relaciones, que le permite definir relaciones entre varias tablas de la base de datos.

Aquí puede enlazar tablas de la base de datos actual por medio de campos de datos en común. Pulse en el icono Relación nueva para crear las relaciones o simplemente arrastre y coloque con el ratón.

Para acceder a esta orden…

En la ventana del archivo de la base de datos, vaya a Herramientas ▸ Relaciones.

Esta función solo estará disponible si trabaja con 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.

Insertar tablas

If the Relation Design window is open, the selected tables cannot be modified, even in Table Design mode. This ensures that tables are not changed while the relations are being created.

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.

#### Desplazar tabla y modificar tamaño de tabla

Las tablas y su tamaño y organización pueden definirse a voluntad. Para desplazar una tabla se pulsa con el ratón el margen superior y se lleva a la posición deseada. Para aumentar o disminuir el tamaño de presentación, arrastre el borde hacia una de las esquinas.

## 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.

All data fields referring to a primary key will be identified in the table window by a small key symbol.

## 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.

Alternatively, you can also click the New Relation icon in the top area of the relation field and define the relation between two tables in the Relations dialog.

Relación nueva

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.

Al pulsar dos veces sobre una línea de conexión, es posible asignar determinadas propiedades a la relación. Se abre el cuadro de diálogo Relaciones.