Processando...

Questões BANRISUL de Banco de Dados | 123469

#123469
Banca
FAURGS
Matéria
Banco de Dados
Concurso
BANRISUL
Tipo
Múltipla escolha
Comentários
Seja o primeiro a comentar
fácil

(1,0) 1 - 

Observe as tabelas FUNCIONARIOS, PROJETOS e PARTICIPACOES definidas abaixo, usando SQL, que representam funcionários e a participação destes em projetos.

create table PROJETOS

(codp char(2) not null primary key,

cliente varchar(100) not null,

orcamento numeric(15,2) not null,

pais char(2) not null);

create table FUNCIONARIOS

(matr char(2) not null primary key,

nomef varchar(100) not null,

salario numeric(8,2) not null,

pais char(2) not null);


create table PARTICIPACOES

(codp char(2) not null,

matr char(2) not null,

horas integer not null,

primary key (codp, matr),

foreign key (codp) references PROJETOS,

foreign key (matr) references FUNCIONARIOS);

Observe as instâncias destas tabelas.

Considere a consulta SQL abaixo, que segue o padrão SQL2.

SELECT cliente

FROM projetos natural left join participacoes natural join funcionarios

GROUP BY codp, cliente

HAVING count(*) > 1;

A consulta SQL acima recuperará