Relações

Esse comando abrirá a janela Design de relação, que permite que você defina as relações entre as várias tabelas de banco de dados.

Aqui você pode vincular tabelas do banco de dados atual por meio de campos de dados em comum. Clique no ícone Nova relação para criar as relações ou simplesmente arraste e solte com o mouse.

Para acessar este comando...

Em uma janela de arquivo de banco de dados, escolha Ferramentas - Relações.


Ícone Nota

Essa função só estará disponível se você estiver trabalhando com um banco de dados 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.

Ícone

Inserir tabelas

Ícone Nota

Se a janela Design da relação estiver aberta, as tabelas selecionadas não poderão ser modificadas, mesmo no modo Design da tabela. Isto garante que as tabelas não sejam alteradas enquanto as relações estiverem sendo criadas.


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.

Mover tabela e modificar tamanho de tabela

Você pode redimensionar e dispor as tabelas de acordo com as suas preferências. Para mover as tabelas, arraste a borda superior até a posição desejada. Amplie ou reduza o tamanho no qual a tabela será exibida, posicionando o cursor do mouse sobre uma borda ou sobre um canto e arrastando a tabela até o tamanho desejado.

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.

Todos os campos de dados que se referirem à chave primária serão identificados na janela da tabela por um símbolo de chave pequena.

Definir relações

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.

Outra alternativa seria clicar no ícone Nova relação na área superior do campo de relação e definir a relação entre as duas tabelas na caixa de diálogo Relações.

Ícone

Nova relação

Ícone Aviso

If you use LibreOfficeDev as the front-end for a relational database, the creation and deletion of relationships is not placed in an intermediate memory by LibreOfficeDev, but is forwarded directly to the database.


Clicando duas vezes em uma linha de conexão, pode-se atribuir certas propriedades à relação. A caixa de diálogo Relações é aberta.