daily pastebin goal
9%
SHARE
TWEET

Exercício 05 MySql

a guest Dec 7th, 2017 61 in 172 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. delimiter $$
  2. create trigger excluirFuncionario after delete on funcionario
  3. for each row
  4. begin
  5.     delete from dependente
  6.     where fcpf = old.cpf;
  7.  
  8.     update departamento
  9.     set departamento.cpf_gerente = null
  10.     where departamento.cpf_gerente = old.cpf;
  11.  
  12.     update funcionario
  13.     set funcionario.cpf_supervisor = null
  14.     where funcionario.cpf_supervisor = old.cpf;
  15.  
  16. end$$
  17. delimiter ;
RAW Paste Data
Top