Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create user dba1;
  2. create user medico1;
  3. create user estagiaria2;
  4. create user secretaria2;
  5.  
  6. -- 1)
  7. grant select (nome) on medico to estagiario1;
  8. grant select (nome) on paciente to estagiario1;
  9. grant select (data) on consulta to estagiario1;
  10.  
  11.  
  12. -- 2)
  13. grant insert on funcionario to estagiario1;
  14.  
  15.  
  16. -- 3)
  17. grant select, update, insert on paciente to medico1;
  18.  
  19.  
  20. -- 4)
  21. grant select(salario), update (salario) on funcionario to dba1;
  22.  
  23.  
  24. -- 5)
  25. create view viewMedico2 as select medico.* from medico, ambulatorio where medico.numeroa = ambulatorio.numeroa and ambulatorio.andar = 4;;
  26. select * from viewMedico2;
  27. grant select on viewMedico2 to secretaria1;
  28.  
  29.  
  30. -- 6)
  31. create role consultas1;
  32. grant select on paciente, medico to consultas1;
  33. create user u11;
  34. create user u22;
  35. grant consultas1 to u11, u22;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement