Commit bcf77ca2 authored by E214194U's avatar E214194U
Browse files

f

parent 2c13e2f0
select * from BASETD.rechargeelectrique ;
--Gironde
select * from BASETD.rechargeelectrique t1 where t1.dpartement='Gironde';
--INSEE DOUBLE
select t1.commune,t1.insee from BASETD.rechargeelectrique t1,BASETD.rechargeelectrique t2 where t1.insee=t2.insee and t1.commune!=t2.commune;
drop table Station;
create Table Station as select codestation,
nombrepointsdecharge,
amnageur,
enseigne,
oprateur,
libellstation,
adresse,
longitude,
latitude,
insee,
source,
codepointdecharge
from basetd.rechargeelectrique;
grant select on Station to i2b05b ,i2b06b ,i2b07b;
select * from station ;
select * from I2B05B.commune ;
select * from I2B07B.departement;
select * from I2B06B.borne;
--Q5
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Loire-Atlantique'
group by amnageur,commune
order by 1;
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Vende'
group by amnageur,commune
order by 1;
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Sarthe'
group by amnageur,commune
order by 1;
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Mayenne'
group by amnageur,commune
order by 1;
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Maine-et-Loire'
group by amnageur,commune
order by 1;
select amnageur,puissancemaximum,sum(nombrepointsdecharge) nbrprise
from I2B06B.borne natural join station
group by amnageur,puissancemaximum
order by 1;
select commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Loire-Atlantique'
group by commune
order by 1;
select commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Vende'
group by commune
order by 1;
select commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Sarthe'
group by commune
order by 1;
select commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Mayenne'
group by commune
order by 1;
select commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Maine-et-Loire'
group by commune
order by 1;
--7
create or replace view nbrpriseAmnLA as
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Loire-Atlantique'
group by amnageur,commune
order by 1;
create or replace view nbrpriseAmnVE as
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Vende'
group by amnageur,commune
order by 1;
create or replace view nbrpriseAmnSA as
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Sarthe'
group by amnageur,commune
order by 1;
create or replace view nbrpriseAmnMA as
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Mayenne'
group by amnageur,commune
order by 1;
create or replace view nbrpriseAmnML as
select amnageur,commune,sum(nombrepointsdecharge) nbrprise
from I2B05B.commune natural join I2B07B.departement natural join station
where dpartement='Maine-et-Loire'
group by amnageur,commune
order by 1;
create or replace view nbrpriseAmnPDL as
select * from nbrpriseAmnLA
union all
select * from nbrpriseAmnVE
union all
select * from nbrpriseAmnSA
union all
select * from nbrpriseAmnMA
union all
select * from nbrpriseAmnML;
select * from nbrpriseAmnPDL;
\ No newline at end of file
select * from BASETD.rechargeelectrique ;
--Gironde
select * from BASETD.rechargeelectrique t1 where t1.département='Gironde';
--INSEE DOUBLE
select t1.commune,t1.insee from BASETD.rechargeelectrique t1,BASETD.rechargeelectrique t2 where t1.insee=t2.insee and t1.commune!=t2.commune;
drop table Station;
create Table Station as select codestation,
nombrepointsdecharge,
aménageur,
enseigne,
opérateur,
libelléstation,
adresse,
longitude,
latitude,
insee,
source,
codepointdecharge
from basetd.rechargeelectrique;
grant select on Station to i2b05b ,i2b06b ,i2b07b;
select * from Station where insee='85234.0';
select * from I2B05B.commune ;
select * from I2B07B.departement;
select * from I2B06B.borne;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment