forked from leonardofl/jornalismo_hacker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17a1ed8
commit c32dd36
Showing
4 changed files
with
553 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
create view maiores as select * from contratos where vol2014 != "" AND vol2013 != "" order by vol2014 desc limit 50; | ||
|
||
create view shoppings as select * from contratos where vol2014 != "" AND vol2013 != "" AND cliente like "%shopping%"; | ||
|
||
create view shopping_oculto as select * from contratos where (vol2014 = "" OR vol2013 = "") AND cliente like "%shopping%"; | ||
|
||
create view igrejas as select cliente from contratos where cliente like "%igreja%"; | ||
|
||
-- analisa variação no consumo de água de 2013 para 2014 de alguns segmentos | ||
|
||
select cliente, vol2014, (vol2014 - vol2013) as dif, round (((vol2014 - vol2013) * 1.0 /vol2013), 4) * 100 as percentual from maiores order by percentual desc; | ||
|
||
select cliente, vol2014, (vol2014 - vol2013) as dif, round (((vol2014 - vol2013) * 1.0 /vol2013), 4) * 100 as percentual from shoppings order by percentual desc; | ||
|
||
select cliente, vol2014, (vol2014 - vol2013) as dif, round (((vol2014 - vol2013) * 1.0 /vol2013), 4) * 100 as percentual from igrejas order by percentual desc; |
Oops, something went wrong.