Banco de DadosColégio Pedro II2017Colégio Pedro II
Considere o seguinte banco de dados:
Professor (Nome,Código, I.D., Salário)
Aluno (Nome,Matrícula, Data-Nasc, Endereço)
Disciplina (Nome,Código, Horas-Semanais)
Leciona (Código-Prof, Código-Discip)
Matriculado-em (Matrícula, Código-Discip, Nota)
Foram propostos os seguintes comandos em SQL para obter os dados do aluno (Tabela Aluno) que obteve a maior nota
na disciplina de nome “Lógica”.
I. select * from aluno where matricula in
(select matricula from matriculado_em where nota in
(select MAX(nota)from matriculado_em where cod_disc in
(select codigo from disciplina where nome = 'Lógica')));
II. select * from aluno where matricula in
(select MAX(nota) from matriculado_em where cod_disc in
(select codigo from disciplina where nome = 'Lógica'));
III.selectaluno.* from aluno, matriculado_em where aluno.matricula=matriculado_em.matriculaandnotain
(select MAX(nota)from matriculado_em where cod_discin
(select codigo from disciplina where nome = 'Lógica'));
IV.selectaluno.*,MAX(nota) from aluno, matriculado_em where cod_discin(select codigo from disciplina where nome = 'Lógica')
Os comandos corretos são
Atalho: tecle de A a D para responder
Comentários da comunidade
Entre para participar da discussão.
Entrar para comentar