Advertisement
CarlosWGama

LBD - PostgreSQL - PLSQL - Atividade

Sep 17th, 2024
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- CARGOS
  2. CREATE TABLE cargos (
  3.     id serial primary key,
  4.     cargo varchar,
  5.     aumento numeric(7,2)
  6. );
  7.  
  8. INSERT INTO cargos (cargo, aumento) values ('diretor', 1000), ('coordenador', 500), ('professor', 200);
  9.  
  10.  
  11. -- FUNCIONARIOS
  12. CREATE TABLE funcionarios (
  13.     id serial primary key,
  14.     nome varchar,
  15.     salario numeric,
  16.     cargo_id integer REFERENCES cargos(id),
  17.     excluido boolean
  18. );
  19.  
  20. INSERT INTO funcionarios (nome, salario, cargo_id, excluido) values ('Carlos', 2000, 3, true), ('João', 2500, 3, true), ('Thiago', 4000, 2, false), ('Marcio', 4300, 2, true), ('Diogo', 1200, 2, false), ('Maria', 5000, 1, true), ('Helena', 5000, 1, false);
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement