Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alexandre CLENET
IUT
Commits
bcf77ca2
Commit
bcf77ca2
authored
Apr 08, 2022
by
E214194U
Browse files
f
parent
2c13e2f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
BD/mini projet/Mini-Projet.odt
0 → 100644
View file @
bcf77ca2
File added
BD/mini projet/projet.sql
0 → 100644
View file @
bcf77ca2
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
BD/projet.sql
deleted
100644 → 0
View file @
2c13e2f0
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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment