Trabalho De Banco De Dados
Trabalho Universitário: Trabalho De Banco De Dados. Pesquise 861.000+ trabalhos acadêmicosPor: CotocoSan • 21/11/2013 • 593 Palavras (3 Páginas) • 426 Visualizações
1)
Select Vnd_numero, Vnd_data, Cli_codigo, Vnd_total from vendas
where Vnd_data between '2010/02/01' and '2010/02/15'
order by Vnd_total desc
2) Insert Into Segmentos (Seg_codigo,Seg_descricao) Values (24,'Kleber'), (25 ,'Pedro'), (26 ,'Luiz'), (27 ,'Felipe'), (28 ,'Lucas');
3)
Select CL.Cli_Nome, CL.Cli_Endereco, CL.Cli_CEP,CD.Cid_descricao from Clientes CL
left join cidades CD on CD.Cid_Codigo=CL.Cid_Codigo
where CL.Cli_Nome like '%JOSE%'
order by CL.Cli_Nome
4)
insert into Vendedor
(Vend_Nome, Vend_Apelido, Vend_Comissao)
values
('CARLOS','CARLINHO',1.6),
('GEORGE','GEGE',2.0),
('MANUEL','MANE',1.7)
5)
update clientes
set cli_nome='JOSÉ DA SILVA', Cli_CEP='17089-101'
where cli_codigo=11
6)
Select VD.Vnd_data, CL.Cli_nome, VR.Vend_nome,VD.Vnd_total from vendas VD
left join clientes CL on CL.Cli_Codigo=VD.Cli_Codigo
left join vendedor VR on VR.Vend_Codigo=VD.Vend_Codigo
order by VD.Vnd_data desc
7)
select vd.Vnd_Data, cl.cli_nome, cd.cid_descricao, vd.Vnd_Total from vendas vd
left join clientes cl on cl.cli_codigo=vd.cli_codigo
left join cidades cd on cd.Cid_Codigo=vd.Vend_Codigo
where vd.vnd_data between '2010/01/01' and '2010/01/31'
order by vd.Vnd_Data desc
8)
Select VD.Cli_Codigo,CL.Cli_Nome, sum(Vnd_Total)from vendas VD
left join clientes CL on CL.Cli_Codigo=VD.Cli_Codigo
group by CL.Cli_Codigo
order by sum(Vnd_Total)
9)
Update Cidades
Set Cid_UF = 'RR'
Where Cid_UF = 'MG';
10)
delete from segmentos
where seg_codigo in (10,12,15,17,20)
11)
select vn.vend_codigo, vn.vend_nome, sum(vd.vnd_total), vd.vnd_numero from vendas vd
left join vendedor vn on vn.vend_codigo=vd.cli_codigo
group by vn.vend_codigo
order by vd.vnd_total desc
1)
Select Vnd_numero, Vnd_data, Cli_codigo, Vnd_total from vendas
where Vnd_data between '2010/02/01' and '2010/02/15'
order by Vnd_total desc
2) Insert Into Segmentos (Seg_codigo,Seg_descricao) Values (24,'Kleber'), (25 ,'Pedro'), (26 ,'Luiz'), (27 ,'Felipe'), (28 ,'Lucas');
3)
Select CL.Cli_Nome, CL.Cli_Endereco, CL.Cli_CEP,CD.Cid_descricao from Clientes CL
left join cidades CD on CD.Cid_Codigo=CL.Cid_Codigo
where CL.Cli_Nome like '%JOSE%'
order by CL.Cli_Nome
4)
insert into Vendedor
(Vend_Nome, Vend_Apelido, Vend_Comissao)
values
('CARLOS','CARLINHO',1.6),
('GEORGE','GEGE',2.0),
('MANUEL','MANE',1.7)
5)
update clientes
set cli_nome='JOSÉ DA SILVA', Cli_CEP='17089-101'
where cli_codigo=11
6)
Select VD.Vnd_data, CL.Cli_nome, VR.Vend_nome,VD.Vnd_total from vendas VD
left join clientes CL on CL.Cli_Codigo=VD.Cli_Codigo
left join vendedor VR on VR.Vend_Codigo=VD.Vend_Codigo
order by VD.Vnd_data desc
7)
select vd.Vnd_Data, cl.cli_nome, cd.cid_descricao, vd.Vnd_Total from vendas vd
left join clientes cl on cl.cli_codigo=vd.cli_codigo
left join cidades cd on cd.Cid_Codigo=vd.Vend_Codigo
where vd.vnd_data between '2010/01/01' and '2010/01/31'
order by vd.Vnd_Data desc
8)
Select VD.Cli_Codigo,CL.Cli_Nome, sum(Vnd_Total)from vendas VD
left join clientes CL on CL.Cli_Codigo=VD.Cli_Codigo
group by CL.Cli_Codigo
order by sum(Vnd_Total)
9)
Update Cidades
Set Cid_UF = 'RR'
...