Buscar

Gabarito - Lista 6 - Banco de Dados II

Esta é uma pré-visualização de arquivo. Entre para ver o arquivo original

/* 1 */ 
select nomeartistico , idade from ator where idade < ( select avg(idade) from ator) order by nomeartistico ;
/* 2 */
select nomereal , nomeartistico from ator where idade = ( select max(idade) from ator ) ;
/* 3 */
select personagem, cache from personagem where codator in ( select codator from ator where sexo = 'F' ) and codfilme in ( select codfilme from filme where tempo > 10 ) order by 1;
/* 4 */
select personagem , cache from personagem where cache > ( select avg(cache) from personagem ) and codator in ( select codator from ator where not nacionalidade= 'USA'); 
/*5*/
create view visao_1 as select nomeartistico , idade from ator where idade < ( select avg(idade) from ator) order by nomeartistico ;
 
create view visao_2 as select nomereal , nomeartistico from ator where idade = ( select max(idade) from ator ) ;
 
create view visao_3 as select personagem, cache from personagem where codator in ( select codator from ator where sexo = 'F' ) and codfilme in ( select codfilme from filme where tempo > 10 ) order by 1;
 
create view visao_4 as select personagem , cache from personagem where cache > ( select avg(cache) from personagem ) and codator in ( select codator from ator where not nacionalidade= 'USA'); 
 
select nomeartistico,idade from visao_1 ;
 
 
drop view visao_1 ;
drop view visao_2 ;
drop view visao_3 ;
drop view visao_4 ;

Teste o Premium para desbloquear

Aproveite todos os benefícios por 3 dias sem pagar! 😉
Já tem cadastro?

Continue navegando

Outros materiais