Buscar

Identify, for each operation on this database, if any relational model constraint can be violated. If there is a violation, identify which one and ...

Identify, for each operation on this database, if any relational model constraint can be violated. If there is a violation, identify which one and justify your answer.


1. Insert <“Cecília”, null, 13/09/1980, F, 3000, 20000, 2> into Empregado.
2. Insert <“Cristina”, 30001, 25/10/1971, F, 2500, 20000, 2> into Empregado.
3. Insert <“Cecília”, 10004, 13/09/1980, F, “três mil”, 20000, 2> into Empregado.
4. Insert <“Cecília”, 10004, 13/09/1980, F, 3000, 20000, 6> into Empregado.
5. Insert <“Cecília”, 40001, 13/09/1980, F, 3000, 20000, 2> into Empregado.
6. Remove the tuple from Departamento where NumeroDep=1;
7. Remove the tuple from Departamento where NumeroDep=4;
8. Remove the tuple from empregado where Matrícula=20000;
9. Change the Salary of the Employee with Matrícula=2000 to 4500;
10. Change the Department Number (NumeroDep) of the Employee with Matrícula=20000 to 1;
11. Change the Department Number (NumeroDep) of the Employee with Matrícula=40000 to 2;
12. Change the Matrícula of the Employee with Matrícula 20000 to 20001;
13. Change the Matrícula of the Employee with Matrícula 10003 to 10002;

Essa pergunta também está no material:

Exercicio Banco de Dados 1
1 pág.

Desenvolvimento em Banco de Dados Universidade Federal de Minas GeraisUniversidade Federal de Minas Gerais

💡 1 Resposta

User badge image

Ed Verified user icon

Vamos analisar cada operação e verificar se alguma restrição do modelo relacional pode ser violada: 1. Insert <“Cecília”, null, 13/09/1980, F, 3000, 20000, 2> into Empregado. - Nenhuma restrição é violada nesta operação. 2. Insert <“Cristina”, 30001, 25/10/1971, F, 2500, 20000, 2> into Empregado. - Nenhuma restrição é violada nesta operação. 3. Insert <“Cecília”, 10004, 13/09/1980, F, “três mil”, 20000, 2> into Empregado. - A restrição de tipo de dado é violada, pois o valor "três mil" não é um número válido para o campo de salário. 4. Insert <“Cecília”, 10004, 13/09/1980, F, 3000, 20000, 6> into Empregado. - A restrição de chave estrangeira é violada, pois o departamento com o número 6 não existe na tabela Departamento. 5. Insert <“Cecília”, 40001, 13/09/1980, F, 3000, 20000, 2> into Empregado. - Nenhuma restrição é violada nesta operação. 6. Remove the tuple from Departamento where NumeroDep=1; - Nenhuma restrição é violada nesta operação. 7. Remove the tuple from Departamento where NumeroDep=4; - Nenhuma restrição é violada nesta operação. 8. Remove the tuple from empregado where Matrícula=20000; - Nenhuma restrição é violada nesta operação. 9. Change the Salary of the Employee with Matrícula=2000 to 4500; - Nenhuma restrição é violada nesta operação. 10. Change the Department Number (NumeroDep) of the Employee with Matrícula=20000 to 1; - Nenhuma restrição é violada nesta operação. 11. Change the Department Number (NumeroDep) of the Employee with Matrícula=40000 to 2; - Nenhuma restrição é violada nesta operação. 12. Change the Matrícula of the Employee with Matrícula 20000 to 20001; - Nenhuma restrição é violada nesta operação. 13. Change the Matrícula of the Employee with Matrícula 10003 to 10002; - Nenhuma restrição é violada nesta operação. Espero ter ajudado! Se tiver mais alguma dúvida, é só perguntar.

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