Buscar

What are the steps to create a N:N relationship in a database? Create a new table with the primary keys of the corresponding entities linked by the...

What are the steps to create a N:N relationship in a database?
Create a new table with the primary keys of the corresponding entities linked by the relationship, in which these keys migrate as foreign keys in the new table
Add other fields according to other attributes present in the relationship
Apply the 'not null' constraint to the fields that cannot accept null values
Apply the 'check' constraint to the fields that must meet a validation expression
Define the primary key, which prevents the sharing of values in different rows for certain fields
Define the foreign key, which distinguishes the values of a field that are present in another table

Essa pergunta também está no material:

PK e FK - Amanda Souza - GU3018067
3 pág.

Programação Orientada A Objetos Instituto Federal de Educação, Ciência e Tecnologia de São PauloInstituto Federal de Educação, Ciência e Tecnologia de São Paulo

💡 1 Resposta

User badge image

Ed Verified user icon

Os passos para criar um relacionamento N:N em um banco de dados são: 1. Crie uma nova tabela com as chaves primárias das entidades correspondentes ligadas pelo relacionamento, em que essas chaves migram como chaves estrangeiras na nova tabela. 2. Adicione outros campos de acordo com outros atributos presentes no relacionamento. 3. Aplique a restrição 'not null' aos campos que não podem aceitar valores nulos. 4. Aplique a restrição 'check' aos campos que devem atender a uma expressão de validação. 5. Defina a chave primária, que impede o compartilhamento de valores em diferentes linhas para determinados campos. 6. Defina a chave estrangeira, que distingue os valores de um campo que estão presentes em outra tabela.

0
Dislike0

✏️ Responder

SetasNegritoItálicoSublinhadoTachadoCitaçãoCódigoLista numeradaLista com marcadoresSubscritoSobrescritoDiminuir recuoAumentar recuoCor da fonteCor de fundoAlinhamentoLimparInserir linkImagemFórmula

Para escrever sua resposta aqui, entre ou crie uma conta

User badge image

Outros materiais