diff --git a/Table_definition/Unify_States.sql b/Table_definition/Unify_States.sql new file mode 100644 index 0000000000000000000000000000000000000000..0266fff143ee9017d77689c76b1f5c8ea3ee62d9 --- /dev/null +++ b/Table_definition/Unify_States.sql @@ -0,0 +1,38 @@ +-- +--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 Brasil AS +SELECT + regiao.id AS regiao_id, + regiao.nome AS nome_regiao, + estado.id AS estado_id, + estado.nome AS nome_estado, + estado.sigla AS sigla_estado, + municipio.id AS municipio_id, + municipio.nome AS nome_municipio +FROM + regiao, + estado, + municipio +WHERE + regiao.id = estado.regiao_id AND + estado.id = municipio.estado_id +; \ No newline at end of file diff --git a/Table_definition/admission.sql b/Table_definition/admission.sql new file mode 100644 index 0000000000000000000000000000000000000000..3d01566fbc914d51c4f0604b2362ac02fb4037b5 --- /dev/null +++ b/Table_definition/admission.sql @@ -0,0 +1,60 @@ +-- +--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 admission_ag +AS +SELECT + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.nome_ies, + aluno_ens_superior.cod_ies, + aluno_ens_superior.ano_censo, + COUNT(*) AS total + +FROM + aluno_ens_superior + +WHERE + (reserva_vagas = 1) AND + (cod_categoria_administrativa IN (1)) AND + (cod_organizacao_academica IN (1, 4, 5)) AND + (ingressante = 1) + +GROUP BY + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.nome_ies, + aluno_ens_superior.cod_ies, + + aluno_ens_superior.ano_censo + +ORDER BY + aluno_ens_superior.turno_aluno ASC, + aluno_ens_superior.descricao_genero_aluno ASC, + aluno_ens_superior.cor_raca_aluno ASC, + aluno_ens_superior.nome_curso ASC, + aluno_ens_superior.nome_ies ASC, + aluno_ens_superior.cod_ies ASC, + aluno_ens_superior.ano_censo ASC +; \ No newline at end of file diff --git a/Table_definition/african_culture.sql b/Table_definition/african_culture.sql new file mode 100644 index 0000000000000000000000000000000000000000..caa3f38d531ece563d97ed925ceec72ebdb57593 --- /dev/null +++ b/Table_definition/african_culture.sql @@ -0,0 +1,53 @@ +-- +--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 african_culture_ag +AS +SELECT + familias_cadunico.ano_censo, + familias_cadunico.cod_especie_domicilio, + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + pessoas_cadunico.codigo_ibge, + COUNT(*) AS Total + +FROM + familias_cadunico + INNER JOIN + pessoas_cadunico + ON (familias_cadunico.id_familia=pessoas_cadunico.id_familia AND familias_cadunico.ano_censo=pessoas_cadunico.ano_censo) + +WHERE + ind_tipo_familia = 203 + +GROUP BY + familias_cadunico.ano_censo, + familias_cadunico.cod_especie_domicilio, + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + pessoas_cadunico.codigo_ibge + +ORDER BY + familias_cadunico.ano_censo , + familias_cadunico.cod_especie_domicilio , + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + pessoas_cadunico.codigo_ibge + ; \ No newline at end of file diff --git a/Table_definition/african_rights.sql b/Table_definition/african_rights.sql new file mode 100644 index 0000000000000000000000000000000000000000..c8546cbec013639afcca5d1b335ca35b844b35f3 --- /dev/null +++ b/Table_definition/african_rights.sql @@ -0,0 +1,70 @@ +-- +--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 african_rights_ag +AS +SELECT + familias_cadunico.ano_censo, + familias_cadunico.ind_tipo_familia, + pessoas_cadunico.concluiu_frequentou, + pessoas_cadunico.ano_serie_frequentou, + pessoas_cadunico.curso_frequentou, + COUNT(*) AS Total + +FROM + + -- Data from CadUnico + familias_cadunico + INNER JOIN + pessoas_cadunico + ON (familias_cadunico.id_familia=pessoas_cadunico.id_familia AND familias_cadunico.ano_censo=pessoas_cadunico.ano_censo) + + +WHERE + ind_tipo_familia = 203 + + +GROUP BY + familias_cadunico.ano_censo, + familias_cadunico.ind_tipo_familia, + pessoas_cadunico.concluiu_frequentou, + pessoas_cadunico.ano_serie_frequentou, + pessoas_cadunico.curso_frequentou + +ORDER BY + familias_cadunico.ano_censo ASC, + familias_cadunico.ind_tipo_familia, + pessoas_cadunico.concluiu_frequentou ASC, + pessoas_cadunico.ano_serie_frequentou ASC, + pessoas_cadunico.curso_frequentou ASC + ; + + + + + + + + + + + + + diff --git a/Table_definition/african_sustentability.sql b/Table_definition/african_sustentability.sql new file mode 100644 index 0000000000000000000000000000000000000000..1616b4fb572eadfb56b49125da03647aa2aca97f --- /dev/null +++ b/Table_definition/african_sustentability.sql @@ -0,0 +1,47 @@ +-- +--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 african_sustentability_ag +AS +SELECT + familias_cadunico.ano_censo, + familias_cadunico.ind_tipo_familia, + familias_cadunico.renda_media, + COUNT(*) AS Total + +FROM + + -- Data from CadUnico + familias_cadunico + +WHERE + ind_tipo_familia = 203 + + +GROUP BY + familias_cadunico.ano_censo, + familias_cadunico.ind_tipo_familia, + familias_cadunico.renda_media + +ORDER BY + familias_cadunico.ano_censo ASC, + familias_cadunico.ind_tipo_familia, + familias_cadunico.renda_media ASC + ; \ No newline at end of file diff --git a/Table_definition/cad_unico.sql b/Table_definition/cad_unico.sql new file mode 100644 index 0000000000000000000000000000000000000000..e40f9900afad1fac2ea15a00ba6e9da08ad97d79 --- /dev/null +++ b/Table_definition/cad_unico.sql @@ -0,0 +1,108 @@ +-- +--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 cad_unico_ag +AS +SELECT + familias_cadunico.ano_censo, + familias_cadunico.renda_media, + familias_cadunico.cod_especie_domicilio, + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + familias_cadunico.cod_iluminacao_domicilio, + familias_cadunico.cod_destino_lixo_domicilio, + familias_cadunico.cod_abastecimento_agua_domicilio, + familias_cadunico.marca_programa_bolsa_familia, + familias_cadunico.ind_familia_quilombola, + familias_cadunico.cod_escoa_sanitario_domicilio, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.idade, + pessoas_cadunico.codigo_ibge, + pessoas_cadunico.concluiu_frequentou, + pessoas_cadunico.ano_serie_frequentou, + pessoas_cadunico.curso_frequentou, + pessoas_cadunico.genero, + geographic.nome_regiao, + geographic.sigla_estado, + COUNT(*) AS Total + +FROM + + -- Data from CadUnico + familias_cadunico + INNER JOIN + pessoas_cadunico + ON (familias_cadunico.id_familia=pessoas_cadunico.id_familia AND familias_cadunico.ano_censo=pessoas_cadunico.ano_censo) + INNER JOIN + + -- Geogrphic (State/Region) data + ( + SELECT + municipio.id AS municipio_id, + regiao.nome AS nome_regiao, + estado.sigla AS sigla_estado + FROM + estado INNER JOIN municipio ON (estado.id = municipio.estado_id) + INNER JOIN regiao ON (regiao.id = estado.regiao_id) + ) AS geographic ON (geographic.municipio_id = pessoas_cadunico.codigo_ibge) + + +GROUP BY + familias_cadunico.ano_censo, + familias_cadunico.renda_media, + familias_cadunico.cod_especie_domicilio, + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + familias_cadunico.cod_iluminacao_domicilio, + familias_cadunico.cod_destino_lixo_domicilio, + familias_cadunico.cod_abastecimento_agua_domicilio, + familias_cadunico.marca_programa_bolsa_familia, + familias_cadunico.ind_familia_quilombola, + familias_cadunico.cod_escoa_sanitario_domicilio, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.idade, + pessoas_cadunico.codigo_ibge, + pessoas_cadunico.concluiu_frequentou, + pessoas_cadunico.ano_serie_frequentou, + pessoas_cadunico.curso_frequentou, + pessoas_cadunico.genero, + geographic.nome_regiao, + geographic.sigla_estado + +ORDER BY + familias_cadunico.ano_censo ASC, + familias_cadunico.renda_media ASC, + familias_cadunico.cod_especie_domicilio ASC, + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + familias_cadunico.cod_iluminacao_domicilio, + familias_cadunico.cod_destino_lixo_domicilio, + familias_cadunico.cod_abastecimento_agua_domicilio, + familias_cadunico.marca_programa_bolsa_familia, + familias_cadunico.ind_familia_quilombola, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.idade ASC, + pessoas_cadunico.codigo_ibge ASC, + pessoas_cadunico.concluiu_frequentou ASC, + pessoas_cadunico.ano_serie_frequentou ASC, + pessoas_cadunico.curso_frequentou ASC, + geographic.nome_regiao ASC, + geographic.sigla_estado ASC + ; \ No newline at end of file diff --git a/Table_definition/cad_unico_quilombola_metrics.sql b/Table_definition/cad_unico_quilombola_metrics.sql new file mode 100644 index 0000000000000000000000000000000000000000..45fd3442981a039335d9465bcd055d1da18b5c52 --- /dev/null +++ b/Table_definition/cad_unico_quilombola_metrics.sql @@ -0,0 +1,33 @@ +-- +--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 cad_unico_quilombola_metrics_ag +AS +SELECT + ano_censo, max(renda_media) as max_renda, min(renda_media) as min_renda, avg(renda_media) as avg_renda + +FROM + familias_cadunico + +WHERE + ind_familia_quilombola='1' + +GROUP BY + ano_censo; diff --git a/Table_definition/course.sql b/Table_definition/course.sql new file mode 100644 index 0000000000000000000000000000000000000000..ebfd441e7d81b2b94aedb638a2146aab4ef0c225 --- /dev/null +++ b/Table_definition/course.sql @@ -0,0 +1,43 @@ +-- +--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 course_ag +AS +SELECT + curso_temp.ano_censo, + curso_temp.nome_curso + +FROM + ( + SELECT + distinct(nome_curso), + ano_censo + FROM + curso_ens_superior + ) AS curso_temp + +GROUP BY + curso_temp.ano_censo, + curso_temp.nome_curso + +ORDER BY + curso_temp.ano_censo ASC, + curso_temp.nome_curso ASC + ; \ No newline at end of file diff --git a/Table_definition/courseFIES.sql b/Table_definition/courseFIES.sql new file mode 100644 index 0000000000000000000000000000000000000000..9e978ac2999bbb8949fcdb0be361ce77e06e2aff --- /dev/null +++ b/Table_definition/courseFIES.sql @@ -0,0 +1,40 @@ +-- +--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 course_fies_ag +AS +SELECT + fies_temp.ano_censo, + fies_temp.curso +FROM + ( + SELECT + distinct(curso) as curso, + ano_censo + FROM + fies + ) as fies_temp +GROUP BY + fies_temp.ano_censo, + fies_temp.curso +ORDER BY + fies_temp.ano_censo ASC, + fies_temp.curso ASC +; \ No newline at end of file diff --git a/Table_definition/coursePROUNI.sql b/Table_definition/coursePROUNI.sql new file mode 100644 index 0000000000000000000000000000000000000000..482a869ceb717d397326f92730c576a61f934ea2 --- /dev/null +++ b/Table_definition/coursePROUNI.sql @@ -0,0 +1,40 @@ +-- +--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 course_prouni_ag +AS +SELECT + prouni_temp.ano_censo, + prouni_temp.nome_curso +FROM + ( + SELECT + distinct(nome_curso), + ano_censo + FROM + prouni + ) AS prouni_temp +GROUP BY + prouni_temp.ano_censo, + prouni_temp.nome_curso +ORDER BY + prouni_temp.ano_censo ASC, + nome_curso ASC +; \ No newline at end of file diff --git a/Table_definition/eixo2.sql b/Table_definition/eixo2.sql new file mode 100644 index 0000000000000000000000000000000000000000..0eeb0a5ae9fa270c32123a5e03bb62da8d488a1a --- /dev/null +++ b/Table_definition/eixo2.sql @@ -0,0 +1,81 @@ +-- +--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 quilombola_eixo_2_ag +AS +SELECT + familias_cadunico.ano_censo, + familias_cadunico.cod_especie_domicilio, + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + familias_cadunico.cod_iluminacao_domicilio, + familias_cadunico.cod_destino_lixo_domicilio, + familias_cadunico.cod_abastecimento_agua_domicilio, + familias_cadunico.ind_familia_quilombola, + familias_cadunico.cod_escoa_sanitario_domicilio, + geographic.nome_regiao, + geographic.sigla_estado, + COUNT(*) AS Total + +FROM + + -- Data from CadUnico + familias_cadunico + INNER JOIN + + -- Geogrphic (State/Region) data + ( + SELECT + municipio.id AS municipio_id, + regiao.nome AS nome_regiao, + estado.sigla AS sigla_estado + FROM + estado INNER JOIN municipio ON (estado.id = municipio.estado_id) + INNER JOIN regiao ON (regiao.id = estado.regiao_id) + ) AS geographic ON (geographic.municipio_id = familias_cadunico.codigo_ibge) + +WHERE + ind_familia_quilombola = '1' + +GROUP BY + familias_cadunico.ano_censo, + familias_cadunico.cod_especie_domicilio, + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + familias_cadunico.cod_iluminacao_domicilio, + familias_cadunico.cod_destino_lixo_domicilio, + familias_cadunico.cod_abastecimento_agua_domicilio, + familias_cadunico.ind_familia_quilombola, + familias_cadunico.cod_escoa_sanitario_domicilio, + geographic.nome_regiao, + geographic.sigla_estado + +ORDER BY + familias_cadunico.ano_censo ASC, + familias_cadunico.cod_especie_domicilio ASC, + familias_cadunico.ind_tipo_familia, + familias_cadunico.cod_local_domicilio, + familias_cadunico.cod_iluminacao_domicilio, + familias_cadunico.cod_destino_lixo_domicilio, + familias_cadunico.cod_abastecimento_agua_domicilio, + familias_cadunico.ind_familia_quilombola, + geographic.nome_regiao ASC, + geographic.sigla_estado ASC + ; \ No newline at end of file diff --git a/Table_definition/eixo3.sql b/Table_definition/eixo3.sql new file mode 100644 index 0000000000000000000000000000000000000000..f323c4c2cd4e99b462888d8781c511116e0b2697 --- /dev/null +++ b/Table_definition/eixo3.sql @@ -0,0 +1,79 @@ +-- +--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 quilombola_eixo_3_ag +AS +SELECT + familias_cadunico.ano_censo, + familias_cadunico.renda_media, + familias_cadunico.ind_tipo_familia, + familias_cadunico.marca_programa_bolsa_familia, + familias_cadunico.ind_familia_quilombola, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.codigo_ibge, + geographic.nome_regiao, + geographic.sigla_estado, + COUNT(*) AS Total + +FROM + + -- Data from CadUnico + familias_cadunico + INNER JOIN + pessoas_cadunico + ON (familias_cadunico.id_familia=pessoas_cadunico.id_familia AND familias_cadunico.ano_censo=pessoas_cadunico.ano_censo) + INNER JOIN + + -- Geogrphic (State/Region) data + ( + SELECT + municipio.id AS municipio_id, + regiao.nome AS nome_regiao, + estado.sigla AS sigla_estado + FROM + estado INNER JOIN municipio ON (estado.id = municipio.estado_id) + INNER JOIN regiao ON (regiao.id = estado.regiao_id) + ) AS geographic ON (geographic.municipio_id = pessoas_cadunico.codigo_ibge) + +WHERE + ind_familia_quilombola = '1' + +GROUP BY + familias_cadunico.ano_censo, + familias_cadunico.renda_media, + familias_cadunico.ind_tipo_familia, + familias_cadunico.marca_programa_bolsa_familia, + familias_cadunico.ind_familia_quilombola, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.codigo_ibge, + geographic.nome_regiao, + geographic.sigla_estado + +ORDER BY + familias_cadunico.ano_censo ASC, + familias_cadunico.renda_media ASC, + familias_cadunico.ind_tipo_familia, + familias_cadunico.marca_programa_bolsa_familia, + familias_cadunico.ind_familia_quilombola, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.codigo_ibge ASC, + geographic.nome_regiao ASC, + geographic.sigla_estado ASC + ; \ No newline at end of file diff --git a/Table_definition/eixo4.sql b/Table_definition/eixo4.sql new file mode 100644 index 0000000000000000000000000000000000000000..cf4f888478346c690ceef691c07b1020e39a37d7 --- /dev/null +++ b/Table_definition/eixo4.sql @@ -0,0 +1,84 @@ +-- +--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 quilombola_eixo_4_ag +AS +SELECT + familias_cadunico.ano_censo, + familias_cadunico.ind_familia_quilombola, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.idade, + pessoas_cadunico.codigo_ibge, + pessoas_cadunico.concluiu_frequentou, + pessoas_cadunico.ano_serie_frequentou, + pessoas_cadunico.curso_frequentou, + pessoas_cadunico.genero, + geographic.nome_regiao, + geographic.sigla_estado, + COUNT(*) AS Total + +FROM + + -- Data from CadUnico + familias_cadunico + INNER JOIN + pessoas_cadunico + ON (familias_cadunico.id_familia=pessoas_cadunico.id_familia AND familias_cadunico.ano_censo=pessoas_cadunico.ano_censo) + INNER JOIN + + -- Geogrphic (State/Region) data + ( + SELECT + municipio.id AS municipio_id, + regiao.nome AS nome_regiao, + estado.sigla AS sigla_estado + FROM + estado INNER JOIN municipio ON (estado.id = municipio.estado_id) + INNER JOIN regiao ON (regiao.id = estado.regiao_id) + ) AS geographic ON (geographic.municipio_id = pessoas_cadunico.codigo_ibge) + +WHERE + familias_cadunico.ind_familia_quilombola = '1' + +GROUP BY + familias_cadunico.ano_censo, + familias_cadunico.ind_familia_quilombola, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.idade, + pessoas_cadunico.codigo_ibge, + pessoas_cadunico.concluiu_frequentou, + pessoas_cadunico.ano_serie_frequentou, + pessoas_cadunico.curso_frequentou, + pessoas_cadunico.genero, + geographic.nome_regiao, + geographic.sigla_estado + +ORDER BY + familias_cadunico.ano_censo ASC, + familias_cadunico.ind_familia_quilombola, + pessoas_cadunico.atividade_extrativista, + pessoas_cadunico.idade ASC, + pessoas_cadunico.codigo_ibge ASC, + pessoas_cadunico.concluiu_frequentou ASC, + pessoas_cadunico.ano_serie_frequentou ASC, + pessoas_cadunico.curso_frequentou ASC, + geographic.nome_regiao ASC, + geographic.sigla_estado ASC + ; \ No newline at end of file diff --git a/Table_definition/esf_quilombolas.sql b/Table_definition/esf_quilombolas.sql new file mode 100644 index 0000000000000000000000000000000000000000..a96f767de52ae9e6aac100b8acc084413ef389bb --- /dev/null +++ b/Table_definition/esf_quilombolas.sql @@ -0,0 +1,45 @@ +-- +--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 diff --git a/Table_definition/evader.sql b/Table_definition/evader.sql new file mode 100644 index 0000000000000000000000000000000000000000..c439c998d36cc62f0325e0353eb2230d57ebb2f7 --- /dev/null +++ b/Table_definition/evader.sql @@ -0,0 +1,71 @@ +-- +--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 evader_ag +AS +SELECT + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.nome_ies, + aluno_ens_superior.cod_ies, + ies_ens_superior.nome_regiao_ies, + ies_ens_superior.sigla_uf_ies, + aluno_ens_superior.ano_censo, + COUNT(*) AS total + +FROM + aluno_ens_superior + INNER JOIN + ies_ens_superior + ON (aluno_ens_superior.cod_ies = ies_ens_superior.cod_ies) + +WHERE + (aluno_ens_superior.cod_aluno_situacao IN (4,5,7)) AND + (aluno_ens_superior.reserva_vagas = 1) AND + (aluno_ens_superior.cod_categoria_administrativa IN (1)) AND + (aluno_ens_superior.cod_organizacao_academica IN (1, 4, 5)) AND + (aluno_ens_superior.ano_censo = ies_ens_superior.ano_censo) + +GROUP BY + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.nome_ies, + aluno_ens_superior.cod_ies, + aluno_ens_superior.ano_censo, + ies_ens_superior.nome_regiao_ies, + ies_ens_superior.sigla_uf_ies, + aluno_ens_superior.ano_censo + +ORDER BY + aluno_ens_superior.turno_aluno ASC, + aluno_ens_superior.descricao_genero_aluno ASC, + aluno_ens_superior.cor_raca_aluno ASC, + aluno_ens_superior.nome_curso ASC, + aluno_ens_superior.nome_ies ASC, + aluno_ens_superior.cod_ies ASC, + aluno_ens_superior.ano_censo ASC, + ies_ens_superior.nome_regiao_ies ASC, + ies_ens_superior.sigla_uf_ies ASC, + aluno_ens_superior.ano_censo ASC +; \ No newline at end of file diff --git a/Table_definition/extracurricular_activities.sql b/Table_definition/extracurricular_activities.sql new file mode 100644 index 0000000000000000000000000000000000000000..b2dca0bac7b3d96619ba79c4cc85e5ba262d9977 --- /dev/null +++ b/Table_definition/extracurricular_activities.sql @@ -0,0 +1,55 @@ +-- +--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 extracurricular_activities_ag +AS +SELECT + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.cod_ies, + aluno_ens_superior.nome_ies, + aluno_ens_superior.ano_censo, + COUNT(*) AS total +FROM + aluno_ens_superior +WHERE + (reserva_vagas = 1) AND + (bolsa_extensao = 1) AND + (cod_categoria_administrativa IN (1)) AND + (cod_organizacao_academica IN (1, 4, 5)) +GROUP BY + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.cod_ies, + aluno_ens_superior.nome_ies, + aluno_ens_superior.ano_censo +ORDER BY + aluno_ens_superior.turno_aluno ASC, + aluno_ens_superior.descricao_genero_aluno ASC, + aluno_ens_superior.cor_raca_aluno ASC, + aluno_ens_superior.nome_curso ASC, + aluno_ens_superior.cod_ies ASC, + aluno_ens_superior.nome_ies ASC, + aluno_ens_superior.ano_censo ASC +; \ No newline at end of file diff --git a/Table_definition/fies.sql b/Table_definition/fies.sql new file mode 100644 index 0000000000000000000000000000000000000000..45483c327ee12e8c3c845659f5f605afec2acc16 --- /dev/null +++ b/Table_definition/fies.sql @@ -0,0 +1,75 @@ +-- +--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 fies_ag +AS +SELECT + fies.codigo_contrato_fies, + fies.genero, + fies.raca_cor, + fies.nome_ies, + fies.codigo_ies, + fies.campus, + fies.codigo_campus, + fies.percentual_solicitado_financiamento, + fies.tipo_fianca, + fies.sigla_uf, + estado.regiao_id, + fies.curso, + ano_censo, + COUNT(*) AS total + +FROM + fies + INNER JOIN + estado + ON (fies.sigla_uf=estado.sigla) +WHERE + (ano = ano_censo) +GROUP BY + fies.codigo_contrato_fies, + fies.genero, + fies.curso, + fies.raca_cor, + fies.nome_ies, + fies.codigo_ies, + fies.campus, + fies.codigo_campus, + fies.percentual_solicitado_financiamento, + fies.tipo_fianca, + fies.sigla_uf, + estado.regiao_id, + fies.ano_censo, + ano_censo +ORDER BY + fies.genero ASC, + fies.curso ASC, + fies.raca_cor ASC, + fies.nome_ies ASC, + fies.codigo_ies ASC, + fies.campus ASC, + fies.codigo_campus ASC, + fies.percentual_solicitado_financiamento ASC, + fies.tipo_fianca ASC, + fies.sigla_uf ASC, + estado.regiao_id ASC, + fies.ano_censo ASC, + ano_censo ASC +; \ No newline at end of file diff --git a/Table_definition/graduate.sql b/Table_definition/graduate.sql new file mode 100644 index 0000000000000000000000000000000000000000..bc9e918bb5603cb848ebd48f2d6c9bd9c707b5bc --- /dev/null +++ b/Table_definition/graduate.sql @@ -0,0 +1,69 @@ +-- +--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 graduate_ag +AS +SELECT + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.nome_ies, + aluno_ens_superior.cod_ies, + aluno_ens_superior.ano_censo, + ies_ens_superior.nome_regiao_ies, + ies_ens_superior.sigla_uf_ies, + COUNT(*) AS total + +FROM + aluno_ens_superior + INNER JOIN + ies_ens_superior + ON (aluno_ens_superior.cod_ies = ies_ens_superior.cod_ies) + +WHERE + (aluno_ens_superior.reserva_vagas = 1) AND + (aluno_ens_superior.concluinte = 1) AND + (aluno_ens_superior.cod_categoria_administrativa IN (1)) AND + (aluno_ens_superior.cod_organizacao_academica IN (1, 4, 5)) AND + (aluno_ens_superior.ano_censo = ies_ens_superior.ano_censo) + +GROUP BY + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.nome_ies, + aluno_ens_superior.cod_ies, + aluno_ens_superior.ano_censo, + ies_ens_superior.nome_regiao_ies, + ies_ens_superior.sigla_uf_ies + +ORDER BY + aluno_ens_superior.turno_aluno ASC, + aluno_ens_superior.descricao_genero_aluno ASC, + aluno_ens_superior.cor_raca_aluno ASC, + aluno_ens_superior.nome_curso ASC, + aluno_ens_superior.nome_ies ASC, + aluno_ens_superior.cod_ies ASC, + ies_ens_superior.nome_regiao_ies ASC, + ies_ens_superior.sigla_uf_ies ASC, + aluno_ens_superior.ano_censo ASC +; \ No newline at end of file diff --git a/Table_definition/institution.sql b/Table_definition/institution.sql new file mode 100644 index 0000000000000000000000000000000000000000..13111fdb77ceb41c58951d8059a00f34fd5602b9 --- /dev/null +++ b/Table_definition/institution.sql @@ -0,0 +1,52 @@ +-- +--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 institution_ag +AS +SELECT + inst.ano_censo, + nome_ies, + cod_ies, + sigla_uf_ies + +FROM + ies_ens_superior as inst + +WHERE + (ano_censo = ( + SELECT + MAX(ano_censo) + FROM ies_ens_superior as ies + WHERE inst.cod_ies = ies.cod_ies) + ) AND + (cod_categoria_administrativa IN (1)) AND + (cod_organizacao_academica IN (1, 4, 5)) + +GROUP BY + inst.ano_censo, + nome_ies, + cod_ies, + sigla_uf_ies + +ORDER BY + inst.ano_censo ASC, + nome_ies ASC, + sigla_uf_ies +; \ No newline at end of file diff --git a/Table_definition/institutionFIES.sql b/Table_definition/institutionFIES.sql new file mode 100644 index 0000000000000000000000000000000000000000..af86729c965d063573322889f745cfde161cbbeb --- /dev/null +++ b/Table_definition/institutionFIES.sql @@ -0,0 +1,47 @@ +-- +--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 institution_fies_ag +AS +SELECT + fies_temp.ano_censo, + fies_temp.codigo_ies, + fies_temp.nome_ies + +FROM + ( + SELECT + distinct codigo_ies, + nome_ies, + ano_censo + FROM + fies + ) AS fies_temp + + +GROUP BY + fies_temp.ano_censo, + fies_temp.codigo_ies, + fies_temp.nome_ies + +ORDER BY + fies_temp.ano_censo ASC, + fies_temp.codigo_ies ASC +; \ No newline at end of file diff --git a/Table_definition/institutionPROUNI.sql b/Table_definition/institutionPROUNI.sql new file mode 100644 index 0000000000000000000000000000000000000000..efb1fdfb9c32baf9a2113d784f13df2b8b239c09 --- /dev/null +++ b/Table_definition/institutionPROUNI.sql @@ -0,0 +1,43 @@ +-- +--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 institution_prouni_ag +AS +SELECT + prouni_temp.ano_censo, + prouni_temp.nome_ies + +FROM + ( + SELECT + distinct(nome_ies), + ano_censo + FROM + fies + ) AS prouni_temp + +GROUP BY + prouni_temp.ano_censo, + prouni_temp.nome_ies + +ORDER BY + prouni_temp.ano_censo ASC, + prouni_temp.nome_ies ASC +; \ No newline at end of file diff --git a/Table_definition/institutionPrivate.sql b/Table_definition/institutionPrivate.sql new file mode 100644 index 0000000000000000000000000000000000000000..52eb742972e364475b2db6a8f8786475063cc2d0 --- /dev/null +++ b/Table_definition/institutionPrivate.sql @@ -0,0 +1,50 @@ +-- +--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 institution_private_ag +AS +SELECT + inst.ano_censo, + nome_ies, + cod_ies +FROM + ies_ens_superior as inst + +WHERE + (ano_censo = + ( + SELECT + MAX(ano_censo) + FROM + ies_ens_superior as ies + WHERE + inst.cod_ies = ies.cod_ies + ) + ) + +GROUP BY + inst.ano_censo, + nome_ies, + cod_ies + +ORDER BY + inst.ano_censo ASC, + nome_ies ASC + ; diff --git a/Table_definition/pnad.sql b/Table_definition/pnad.sql new file mode 100644 index 0000000000000000000000000000000000000000..02d45769a14b086e2c61da169ad337541501b45e --- /dev/null +++ b/Table_definition/pnad.sql @@ -0,0 +1,59 @@ +-- +--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 pnad_ag +AS +SELECT + pnad.cor_raca_original, + pnad.rede_ensino, + pnad.area_rede_publica_ensino, + pnad.curso_que_frequenta, + estado.sigla, + estado.regiao_id, + ano_censo, + COUNT(*) AS total + +FROM + pnad + INNER JOIN + estado ON (pnad.estado_id=estado.id) + +WHERE + (idade >= 18) AND + (idade <= 24) + +GROUP BY + pnad.cor_raca_original, + pnad.rede_ensino, + pnad.area_rede_publica_ensino, + pnad.curso_que_frequenta, + estado.sigla, + estado.regiao_id, + ano_censo + +ORDER BY + pnad.cor_raca_original ASC, + pnad.rede_ensino ASC, + pnad.area_rede_publica_ensino ASC, + pnad.curso_que_frequenta ASC, + estado.sigla ASC, + estado.regiao_id ASC, + ano_censo ASC +; \ No newline at end of file diff --git a/Table_definition/prouni.sql b/Table_definition/prouni.sql new file mode 100644 index 0000000000000000000000000000000000000000..99fdfa32034876050794a3d94b09faee549e82a8 --- /dev/null +++ b/Table_definition/prouni.sql @@ -0,0 +1,59 @@ +-- +--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 prouni_ag +AS +SELECT + prouni.genero_beneficiario, + prouni.raca_beneficiario, + prouni.nome_curso, + prouni.nome_ies, + prouni.tipo, + prouni.sigla_uf_beneficiario, + prouni.regiao_beneficiario, + prouni.ano_censo, + prouni.nome_turno_curso, + COUNT(*) AS total + +FROM + prouni + +GROUP BY + prouni.genero_beneficiario, + prouni.raca_beneficiario, + prouni.nome_curso, + prouni.nome_ies, + prouni.tipo, + prouni.sigla_uf_beneficiario, + prouni.regiao_beneficiario, + prouni.nome_turno_curso, + prouni.ano_censo + +ORDER BY + prouni.genero_beneficiario ASC, + prouni.raca_beneficiario ASC, + prouni.nome_curso ASC, + prouni.nome_ies ASC, + prouni.tipo ASC, + prouni.sigla_uf_beneficiario ASC, + prouni.regiao_beneficiario ASC, + prouni.nome_turno_curso ASC, + prouni.ano_censo ASC +; diff --git a/Table_definition/social_support.sql b/Table_definition/social_support.sql new file mode 100644 index 0000000000000000000000000000000000000000..6eb72e1ace60c0691c1be13dc6a6491afec26518 --- /dev/null +++ b/Table_definition/social_support.sql @@ -0,0 +1,77 @@ +-- +--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 social_support_ag +AS +SELECT + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.cod_ies, + aluno_ens_superior.nome_ies, + aluno_ens_superior.apoio_alimentacao, + aluno_ens_superior.apoio_bolsa_permanencia, + aluno_ens_superior.apoio_bolsa_trabalho, + aluno_ens_superior.apoio_material_didatico, + aluno_ens_superior.apoio_moradia, + aluno_ens_superior.apoio_transporte, + aluno_ens_superior.ano_censo, + COUNT(*) AS total + +FROM + aluno_ens_superior + +WHERE + (reserva_vagas = 1) AND + (apoio_social = 1) AND + (cod_categoria_administrativa IN (1)) AND + (cod_organizacao_academica IN (1, 4, 5)) + +GROUP BY + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.cod_ies, + aluno_ens_superior.nome_ies, + aluno_ens_superior.apoio_alimentacao, + aluno_ens_superior.apoio_bolsa_permanencia, + aluno_ens_superior.apoio_bolsa_trabalho, + aluno_ens_superior.apoio_material_didatico, + aluno_ens_superior.apoio_moradia, + aluno_ens_superior.apoio_transporte, + aluno_ens_superior.ano_censo + +ORDER BY + aluno_ens_superior.turno_aluno ASC, + aluno_ens_superior.descricao_genero_aluno ASC, + aluno_ens_superior.cor_raca_aluno ASC, + aluno_ens_superior.nome_curso ASC, + aluno_ens_superior.cod_ies ASC, + aluno_ens_superior.nome_ies ASC, + aluno_ens_superior.apoio_alimentacao ASC, + aluno_ens_superior.apoio_bolsa_permanencia ASC, + aluno_ens_superior.apoio_bolsa_trabalho ASC, + aluno_ens_superior.apoio_material_didatico ASC, + aluno_ens_superior.apoio_moradia ASC, + aluno_ens_superior.apoio_transporte ASC, + aluno_ens_superior.ano_censo ASC +; \ No newline at end of file diff --git a/Table_definition/student_loans.sql b/Table_definition/student_loans.sql new file mode 100644 index 0000000000000000000000000000000000000000..7ddb329e182f49c9a000736f1d0ad6d9cef917eb --- /dev/null +++ b/Table_definition/student_loans.sql @@ -0,0 +1,97 @@ +-- +--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 student_loans_ag +AS +SELECT + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.cod_ies, + aluno_ens_superior.nome_ies, + aluno_ens_superior.financiamento_reembolsavel_fies, + aluno_ens_superior.financiamento_reembolsavel_estadual, + aluno_ens_superior.financiamento_reembolsavel_municipal, + aluno_ens_superior.financiamento_reembolsavel_prog_ies, + aluno_ens_superior.financiamento_reembolsavel_entidade_externa, + aluno_ens_superior.financiamento_reembolsavel_outra, + aluno_ens_superior.financiamento_naoreembolsavel_prouni_integral, + aluno_ens_superior.financiamento_naoreembolsavel_prouni_parcial, + aluno_ens_superior.financiamento_naoreembolsavel_estadual, + aluno_ens_superior.financiamento_naoreembolsavel_municipal, + aluno_ens_superior.financiamento_naoreembolsavel_prog_ies, + aluno_ens_superior.financiamento_naoreembolsavel_entidade_externa, + aluno_ens_superior.financiamento_naoreembolsavel_outra, + aluno_ens_superior.ano_censo, + COUNT(*) AS total + +FROM + aluno_ens_superior + +WHERE + (reserva_vagas = 1) AND + (financiamento_estudantil = 1) AND + (cod_organizacao_academica IN (1, 4, 5)) + +GROUP BY + aluno_ens_superior.turno_aluno, + aluno_ens_superior.descricao_genero_aluno, + aluno_ens_superior.cor_raca_aluno, + aluno_ens_superior.nome_curso, + aluno_ens_superior.cod_ies, + aluno_ens_superior.nome_ies, + aluno_ens_superior.financiamento_reembolsavel_fies, + aluno_ens_superior.financiamento_reembolsavel_estadual, + aluno_ens_superior.financiamento_reembolsavel_municipal, + aluno_ens_superior.financiamento_reembolsavel_prog_ies, + aluno_ens_superior.financiamento_reembolsavel_entidade_externa, + aluno_ens_superior.financiamento_reembolsavel_outra, + aluno_ens_superior.financiamento_naoreembolsavel_prouni_integral, + aluno_ens_superior.financiamento_naoreembolsavel_prouni_parcial, + aluno_ens_superior.financiamento_naoreembolsavel_estadual, + aluno_ens_superior.financiamento_naoreembolsavel_municipal, + aluno_ens_superior.financiamento_naoreembolsavel_prog_ies, + aluno_ens_superior.financiamento_naoreembolsavel_entidade_externa, + aluno_ens_superior.financiamento_naoreembolsavel_outra, + aluno_ens_superior.ano_censo + +ORDER BY + aluno_ens_superior.turno_aluno ASC, + aluno_ens_superior.descricao_genero_aluno ASC, + aluno_ens_superior.cor_raca_aluno ASC, + aluno_ens_superior.nome_curso ASC, + aluno_ens_superior.cod_ies ASC, + aluno_ens_superior.nome_ies ASC, + aluno_ens_superior.financiamento_reembolsavel_fies ASC, + aluno_ens_superior.financiamento_reembolsavel_estadual ASC, + aluno_ens_superior.financiamento_reembolsavel_municipal ASC, + aluno_ens_superior.financiamento_reembolsavel_prog_ies ASC, + aluno_ens_superior.financiamento_reembolsavel_entidade_externa ASC, + aluno_ens_superior.financiamento_reembolsavel_outra ASC, + aluno_ens_superior.financiamento_naoreembolsavel_prouni_integral ASC, + aluno_ens_superior.financiamento_naoreembolsavel_prouni_parcial ASC, + aluno_ens_superior.financiamento_naoreembolsavel_estadual ASC, + aluno_ens_superior.financiamento_naoreembolsavel_municipal ASC, + aluno_ens_superior.financiamento_naoreembolsavel_prog_ies ASC, + aluno_ens_superior.financiamento_naoreembolsavel_entidade_externa ASC, + aluno_ens_superior.financiamento_naoreembolsavel_outra ASC, + aluno_ens_superior.ano_censo ASC +; \ No newline at end of file