Banco de dados - Function
--1
-- Inserir dados na tabela professor create sequence prof_sequ minvalue 100 maxvalue 199 start with 100 increment by 1 cache 100;
insert into professores values
(nextval('prof_sequ'), 'Helder', 100000001, 'M', 24, 'Graduado', 'Titular', 5),
(nextval('prof_sequ'), 'Akio', 200000002, 'M', 22, 'Mestre', 'Adjunto', 4),
(nextval('prof_sequ'), 'Alvim', 300000003, 'M', 21, 'Doutor', 'Auxiliar', 3),
(nextval('prof_sequ'), 'Ito', 400000004, 'M', 20, 'Especialista', 'Assistente', 2),
(nextval('prof_sequ'), 'Renata', 500000005, 'F', 19, 'Especialista', 'Assistente', 6)
--Inserir dados na tabela cursos create sequence curso_sequ minvalue 200 maxvalue 299 start with 200 increment by 1 cache 100;
insert into cursos values
(nextval('curso_sequ'), 'Gestão', 10, 101),
(nextval('curso_sequ'), 'Banco de Dados', 12, 102),
(nextval('curso_sequ'), 'Seguranca da Informação', 6, 103),
(nextval('curso_sequ'), 'Programacão Java',12, 104),
(nextval('curso_sequ'), 'Gestão 2', 5, 105)
--Inserir dados na tabela alunos create sequence aluno_sequ minvalue 300 maxvalue 399 start with 300 increment by 1 cache 100;
insert into alunos values
(nextval('aluno_sequ'), 'Luan', 10000000, 'M', 17, 200),
(nextval('aluno_sequ'), 'Yasmin', 10000001, 'F', 18, 201),
(nextval('aluno_sequ'), 'Pietra', 10000002, 'F', 19, 202),
(nextval('aluno_sequ'), 'Kaue', 10000003, 'M', 20, 203),
(nextval('aluno_sequ'), 'Matheus', 10000004, 'M', 21, 204)
--Inserir dados na tabela Disciplinas create sequence discip_sequ minvalue 400 maxvalue 499 start with 400 increment by 1 cache 100;
insert into disciplinas values
(nextval('discip_sequ'), 'SisINf', 2),
(nextval('discip_sequ'), 'Banco de Dados', 7),
(nextval('discip_sequ'), 'Ciencias da Comp', 8),
(nextval('discip_sequ'), 'Eng da Comp', 5),
(nextval('discip_sequ'), 'TADS', 3)
--Inserir dados na tabela Currículos create sequence curric_sequ minvalue 500 maxvalue 599 start with 500