Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SQL Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HOTMapper
SQL Scripts
Commits
660b68ed
Commit
660b68ed
authored
5 years ago
by
Henrique Varella Ehrenfried
Browse files
Options
Downloads
Plain Diff
Merge branch 'sim' into 'master'
Sim See merge request
!5
parents
c4adf529
a6db4b39
No related branches found
Branches containing commit
No related tags found
1 merge request
!5
Sim
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
README.md
+4
-3
4 additions, 3 deletions
README.md
brasil.sql
+0
-0
0 additions, 0 deletions
brasil.sql
esf_quilombolas.sql
+0
-45
0 additions, 45 deletions
esf_quilombolas.sql
groups.py
+8
-2
8 additions, 2 deletions
groups.py
homicidios.sql
+75
-0
75 additions, 0 deletions
homicidios.sql
with
87 additions
and
50 deletions
README.md
+
4
−
3
View file @
660b68ed
...
...
@@ -66,9 +66,10 @@ Esse script tem como objetivo facilitar a criação do banco de dados do projeto
*
fies
*
institutionFIES
#### SIM
*
homicidios
#### SEM GRUPO
*
Unify_States
*
esf_quilombolas
*
brasil
*
cad_unico
*
cad_unico_quilombas_metrics
*
esf_quilombolas
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Unify_States
.sql
→
brasil
.sql
+
0
−
0
View file @
660b68ed
File moved
This diff is collapsed.
Click to expand it.
esf_quilombolas.sql
deleted
100644 → 0
+
0
−
45
View file @
c4adf529
--
--Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre
--Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
--
--This file is part of SMPPIR-Tables.
--
--SMPPIR-Tables is free software: you can redistribute it and/or modify
--it under the terms of the GNU General Public License as published by
--the Free Software Foundation, either version 3 of the License, or
--(at your option) any later version.
--
--SMPPIR-Tables is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU General Public License for more details.
--
--You should have received a copy of the GNU General Public License
--along with SMPPIR-Tables. If not, see <https://www.gnu.org/licenses/>.
--
CREATE
TABLE
esf_quilombolas
AS
SELECT
brasil
.
municipio_id
AS
municipio_id
,
brasil
.
nome_municipio
AS
nome_municipio
,
brasil
.
estado_id
AS
estado_id
,
brasil
.
sigla_estado
AS
sigla_estado
,
brasil
.
nome_estado
AS
nome_estado
,
brasil
.
regiao_id
AS
regiao_id
,
brasil
.
nome_regiao
AS
nome_regiao
,
equipes_saude
.
cod_municipio
AS
id_municipio_equipes
,
equipes_saude
.
no_referencia
AS
nome_equipe
,
equipes_saude
.
ano_censo
AS
ano_censo
FROM
(
SELECT
municipio_id
AS
id
,
(
municipio_id
/
10
)
AS
id_6
FROM
brasil
)
AS
novo_id
,
equipes_saude
,
brasil
WHERE
novo_id
.
id
=
brasil
.
municipio_id
AND
equipes_saude
.
cod_municipio
=
novo_id
.
id_6
AND
equipes_saude
.
tp_pop_assist_quilomb
=
1
ORDER
BY
equipes_saude
.
ano_censo
,
brasil
.
regiao_id
,
brasil
.
estado_id
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
groups.py
+
8
−
2
View file @
660b68ed
...
...
@@ -55,7 +55,11 @@ FIES = [
'
fies.sql
'
,
'
institutionFIES.sql
'
]
ALL_GROUPS_SMPPIR
=
INEP
+
PROUNI
+
PNAD
+
CADUNICO
+
FIES
SIM
=
[
'
homicidios.sql
'
]
ALL_GROUPS_SMPPIR
=
INEP
+
PROUNI
+
PNAD
+
CADUNICO
+
FIES
+
SIM
# ---------------------------------------------------------------------------------------#
# ---------------------------------------------------------------------------------------#
...
...
@@ -92,6 +96,7 @@ DATA_GROUP = {
"
PNAD
"
:
PNAD
,
"
CADUNICO
"
:
CADUNICO
,
"
FIES
"
:
FIES
,
"
SIM
"
:
SIM
,
"
ALL_GROUPS_SMPPIR
"
:
ALL_GROUPS_SMPPIR
,
"
BASE
"
:
BASE
,
"
SIMCAQ_AGGREGATE
"
:
SIMCAQ_AGGREGATE
...
...
@@ -122,5 +127,6 @@ DATABASE_TABLE_NAME = {
'
courseFIES.sql
'
:
'
course_fies_ag
'
,
'
fies.sql
'
:
'
fies_ag
'
,
'
institutionFIES.sql
'
:
'
institution_fies_ag
'
,
'
idm.sql
'
:
'
indice_distribuicao_matriculas
'
'
idm.sql
'
:
'
indice_distribuicao_matriculas
'
,
'
homicidios.sql
'
:
'
taxa_homicidios
'
}
This diff is collapsed.
Click to expand it.
homicidios.sql
0 → 100644
+
75
−
0
View file @
660b68ed
CREATE
table
taxa_homicidios
AS
SELECT
sim
.
obito
,
pnad
.
pop_ibge
,
pnad
.
pop_pnad
,
pnad
.
pop_filtrada
as
filtro_pnad
,
cast
((
cast
(
pop_ibge
as
float
)
/
cast
(
pop_pnad
as
float
))
*
cast
(
pop_filtrada
as
float
)
as
integer
)
as
filtro_ibge
,
cast
(
obito
as
float
)
*
100000
/
((
cast
(
pop_ibge
as
float
)
/
cast
(
pop_pnad
as
float
))
*
cast
(
pop_filtrada
as
float
))
as
taxa_homicidio
,
sim
.
ano_obito
as
ano
,
sim
.
"ocor_SIGLA_UF"
as
uf
,
sim
.
def_raca_cor
as
raca_cor
FROM
(
select
count
(
*
)
as
obito
,
*
from
sim
where
"CIRCOBITO"
=
3
group
by
ano_obito
,
"ocor_CODIGO_UF"
,
"ocor_SIGLA_UF"
,
def_raca_cor
,
"RACACOR"
)
as
sim
INNER
JOIN
(
select
*
from
(
select
*
,
count
(
*
)
as
pop_filtrada
from
pnad_cont
inner
join
(
select
*
,
count
(
*
)
as
pop_pnad
from
pnad_cont
group
by
ano_censo
,
cod_uf
)
as
pnd
on
pnad_cont
.
ano_censo
=
pnd
.
ano_censo
and
pnad_cont
.
cod_uf
=
pnd
.
cod_uf
group
by
pnad_cont
.
ano_censo
,
pnad_cont
.
cod_uf
,
pnad_cont
.
cor_raca
,
pnd
.
pop_pnad
)
as
pnad
inner
join
(
select
*
,
sum
(
ibge_populacao
.
populacao
)
as
pop_ibge
from
ibge_populacao
group
by
ibge_populacao
.
estado_id
,
ibge_populacao
.
ano_censo
)
as
pop
on
pnad
.
ano_censo
=
pop
.
ano_censo
and
pnad
.
cod_uf
=
pop
.
estado_id
group
by
pnad
.
ano_censo
,
pnad
.
cod_uf
,
pnad
.
cor_raca
,
pop
.
pop_ibge
,
pnad
.
pop_pnad
,
pnad
.
pop_filtrada
)
as
pnad
ON
sim
.
ano_obito
=
pnad
.
ano_censo
and
sim
.
"ocor_CODIGO_UF"
=
pnad
.
cod_uf
and
sim
.
"RACACOR"
=
pnad
.
cor_raca
group
by
sim
.
ano_obito
,
sim
.
obito
,
pnad
.
pop_filtrada
,
sim
.
"ocor_SIGLA_UF"
,
sim
.
def_raca_cor
,
pnad
.
pop_ibge
,
pnad
.
pop_pnad
order
by
sim
.
"ocor_SIGLA_UF"
,
sim
.
ano_obito
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment