Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Consulta 1
- create view alunos_projeto_ano2000(nome_aluno) as
- select distinct(a.nome)
- from aluno a
- where extract(year from a.dt_nasc) = 2000 and cod_projeto is not null
- select * from alunos_projeto_ano2000
- # Consulta 2
- select prof.matricula,prof.nome, sum(proj.orcamento) as "ORCAMENTO_TOTAL"
- from professor prof, projeto proj
- where prof.matricula=proj.mat_professor and extract(year from proj.dt_inicio) < 2007
- group by prof.matricula,prof.nome
- # Consulta 3
- create view laboratorio_projetos2014 as
- select distinct(l.nome)
- from laboratorio l, laboratorio_projeto lp, projeto p
- where l.codigo = lp.cod_laboratorio and p.codigo = lp.cod_projeto and extract(year from p.dt_fim) = 2014
- select * from laboratorio_projetos2014
- # Consulta 4
- select distinct(a.nome)
- from aluno a, aluno_publicacao ap, publicacao p
- where a.matricula = ap.mat_aluno and upper(nivel)='DOUTORADO' and extract(year from a.dt_nasc) between 1982 and 1992 and
- p.ano = 2017
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement