Banco de dadosSql (2)
- (CESPE 2010)
Investimentos
código tipo
12 poupança
23 CDB
34 fundo diamante
Rendimentos
código data rendimento anual
123 12/3/10 10%
234 22/12/10 12%
345 3/3/10 15%
Clientes
código nome idade investimento
123 Mario 46 12
234 Roberta 55 12
345 Anizio 32 23
456 Paula 21 12
567 Fernanda 60 23
678 Paulo 40 34
789 Fabiola 13 34
Investimentos_Rendimentos
investimentos rendimentos
12 123
12 234
23 345
23 456
34 567
A partir das tabelas acima, julgue o item com relação a consultas usando SQL.
Considere a consulta definida pelo código a seguir.
select Investimentos, t2.Data, Rendimento anual from Investimentos t1, Rendimentos t2, Investimentos_Rendimentos t3 where t1.Codigo = Investimentos and t2.Codigo = Rendimentos order by Investimentos, t2.Data;
O resultado correto dessa consulta fornece: 12 12/3/10 10% 23 22/12/10 12%
C) Certo
E) Errado
Próximo:
EXERCÍCIOS - Exercício 99
Vamos para o Anterior: Exercício 97
Tente Este: Exercício 209
Primeiro: Exercício 1
VOLTAR ao índice: Banco de dados